##// END OF EJS Templates
test-config: add tests for invalid syntax...
Pierre-Yves David -
r22275:d9a8017d default
parent child Browse files
Show More
@@ -1,44 +1,66 b''
1 hide outer repo
1 hide outer repo
2 $ hg init
2 $ hg init
3
3
4 Invalid syntax: no value
5
6 $ cat > .hg/hgrc << EOF
7 > novaluekey
8 > EOF
9 $ hg showconfig
10 hg: parse error at $TESTTMP/.hg/hgrc:1: novaluekey
11 [255]
12
13 Invalid syntax: no key
14
15 $ cat > .hg/hgrc << EOF
16 > =nokeyvalue
17 > EOF
18 $ hg showconfig
19 hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue
20 [255]
21
22 Reset hgrc
23
24 $ echo > .hg/hgrc
25
4 Test case sensitive configuration
26 Test case sensitive configuration
5
27
6 $ echo '[Section]' >> $HGRCPATH
28 $ echo '[Section]' >> $HGRCPATH
7 $ echo 'KeY = Case Sensitive' >> $HGRCPATH
29 $ echo 'KeY = Case Sensitive' >> $HGRCPATH
8 $ echo 'key = lower case' >> $HGRCPATH
30 $ echo 'key = lower case' >> $HGRCPATH
9
31
10 $ hg showconfig Section
32 $ hg showconfig Section
11 Section.KeY=Case Sensitive
33 Section.KeY=Case Sensitive
12 Section.key=lower case
34 Section.key=lower case
13
35
14 Test "%unset"
36 Test "%unset"
15
37
16 $ cat >> $HGRCPATH <<EOF
38 $ cat >> $HGRCPATH <<EOF
17 > [unsettest]
39 > [unsettest]
18 > local-hgrcpath = should be unset (HGRCPATH)
40 > local-hgrcpath = should be unset (HGRCPATH)
19 > %unset local-hgrcpath
41 > %unset local-hgrcpath
20 >
42 >
21 > global = should be unset (HGRCPATH)
43 > global = should be unset (HGRCPATH)
22 >
44 >
23 > both = should be unset (HGRCPATH)
45 > both = should be unset (HGRCPATH)
24 >
46 >
25 > set-after-unset = should be unset (HGRCPATH)
47 > set-after-unset = should be unset (HGRCPATH)
26 > EOF
48 > EOF
27
49
28 $ cat >> .hg/hgrc <<EOF
50 $ cat >> .hg/hgrc <<EOF
29 > [unsettest]
51 > [unsettest]
30 > local-hgrc = should be unset (.hg/hgrc)
52 > local-hgrc = should be unset (.hg/hgrc)
31 > %unset local-hgrc
53 > %unset local-hgrc
32 >
54 >
33 > %unset global
55 > %unset global
34 >
56 >
35 > both = should be unset (.hg/hgrc)
57 > both = should be unset (.hg/hgrc)
36 > %unset both
58 > %unset both
37 >
59 >
38 > set-after-unset = should be unset (.hg/hgrc)
60 > set-after-unset = should be unset (.hg/hgrc)
39 > %unset set-after-unset
61 > %unset set-after-unset
40 > set-after-unset = should be set (.hg/hgrc)
62 > set-after-unset = should be set (.hg/hgrc)
41 > EOF
63 > EOF
42
64
43 $ hg showconfig unsettest
65 $ hg showconfig unsettest
44 unsettest.set-after-unset=should be set (.hg/hgrc)
66 unsettest.set-after-unset=should be set (.hg/hgrc)
General Comments 0
You need to be logged in to leave comments. Login now