changeset 22275:d9a8017dce10

test-config: add tests for invalid syntax This was not tested and there is more to come in the next patch.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 20 Aug 2014 22:52:56 -0700
parents 10e87c67f1c7
children b13b99d39a46
files tests/test-config.t
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-config.t	Tue Aug 19 23:22:44 2014 -0700
+++ b/tests/test-config.t	Wed Aug 20 22:52:56 2014 -0700
@@ -1,6 +1,28 @@
 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