[PATCH 1 of 2] test-config: add tests from invalid syntax

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Aug 21 01:13:42 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1408600376 25200
#      Wed Aug 20 22:52:56 2014 -0700
# Node ID b09526f454bd930d851963bda21227f9932bccf8
# Parent  8bf85b30fd02d25d5b140f7d2ab3f89f8af89d7a
test-config: add tests from invalid syntax

That was not tested and there is more to come in the next patch.

diff --git a/tests/test-config.t b/tests/test-config.t
--- a/tests/test-config.t
+++ b/tests/test-config.t
@@ -1,8 +1,30 @@
 hide outer repo
   $ hg init
 
+Invalid syntax: no value
+
+  $ cat > .hg/hgrc << EOF
+  > novaluekey
+  > EOF
+  $ hg showconfig
+  hg: parse error at $TESTTMP/.hg/hgrc:1: novaluekey
+  [255]
+
+Invalid syntax: no key
+
+  $ cat > .hg/hgrc << EOF
+  > =nokeyvalue
+  > EOF
+  $ hg showconfig
+  hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue
+  [255]
+
+reset hgrc
+
+  $ echo > .hg/hgrc
+
 Test case sensitive configuration
 
   $ echo '[Section]' >> $HGRCPATH
   $ echo 'KeY = Case Sensitive' >> $HGRCPATH
   $ echo 'key = lower case' >> $HGRCPATH


More information about the Mercurial-devel mailing list