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

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 21, 2014, 6:13 a.m.
Message ID <b09526f454bd930d8519.1408601622@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5545/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 21, 2014, 6:13 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

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