annotate tests/test-config.t @ 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 7d82ad4b3727
children b13b99d39a46
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17015
73d20de5f30b tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 12082
diff changeset
1 hide outer repo
73d20de5f30b tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 12082
diff changeset
2 $ hg init
73d20de5f30b tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 12082
diff changeset
3
22275
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
4 Invalid syntax: no value
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
5
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
6 $ cat > .hg/hgrc << EOF
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
7 > novaluekey
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
8 > EOF
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
9 $ hg showconfig
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
10 hg: parse error at $TESTTMP/.hg/hgrc:1: novaluekey
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
11 [255]
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
12
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
13 Invalid syntax: no key
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
14
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
15 $ cat > .hg/hgrc << EOF
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
16 > =nokeyvalue
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
17 > EOF
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
18 $ hg showconfig
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
19 hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
20 [255]
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
21
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
22 Reset hgrc
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
23
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
24 $ echo > .hg/hgrc
d9a8017dce10 test-config: add tests for invalid syntax
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19087
diff changeset
25
19086
8fb8dce3f9b6 tests: rename from test-config-case.t to test-config.t for centralization
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17015
diff changeset
26 Test case sensitive configuration
8fb8dce3f9b6 tests: rename from test-config-case.t to test-config.t for centralization
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17015
diff changeset
27
12082
5e2216a35839 tests: unify test-config-case
Adrian Buehlmann <adrian@cadifra.com>
parents: 4528
diff changeset
28 $ echo '[Section]' >> $HGRCPATH
5e2216a35839 tests: unify test-config-case
Adrian Buehlmann <adrian@cadifra.com>
parents: 4528
diff changeset
29 $ echo 'KeY = Case Sensitive' >> $HGRCPATH
5e2216a35839 tests: unify test-config-case
Adrian Buehlmann <adrian@cadifra.com>
parents: 4528
diff changeset
30 $ echo 'key = lower case' >> $HGRCPATH
3425
ec6f400cff4d Use a case-sensitive version of SafeConfigParser everywhere
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
31
12082
5e2216a35839 tests: unify test-config-case
Adrian Buehlmann <adrian@cadifra.com>
parents: 4528
diff changeset
32 $ hg showconfig Section
5e2216a35839 tests: unify test-config-case
Adrian Buehlmann <adrian@cadifra.com>
parents: 4528
diff changeset
33 Section.KeY=Case Sensitive
5e2216a35839 tests: unify test-config-case
Adrian Buehlmann <adrian@cadifra.com>
parents: 4528
diff changeset
34 Section.key=lower case
3425
ec6f400cff4d Use a case-sensitive version of SafeConfigParser everywhere
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
35
19087
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
36 Test "%unset"
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
37
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
38 $ cat >> $HGRCPATH <<EOF
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
39 > [unsettest]
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
40 > local-hgrcpath = should be unset (HGRCPATH)
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
41 > %unset local-hgrcpath
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
42 >
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
43 > global = should be unset (HGRCPATH)
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
44 >
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
45 > both = should be unset (HGRCPATH)
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
46 >
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
47 > set-after-unset = should be unset (HGRCPATH)
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
48 > EOF
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
49
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
50 $ cat >> .hg/hgrc <<EOF
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
51 > [unsettest]
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
52 > local-hgrc = should be unset (.hg/hgrc)
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
53 > %unset local-hgrc
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
54 >
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
55 > %unset global
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
56 >
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
57 > both = should be unset (.hg/hgrc)
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
58 > %unset both
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
59 >
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
60 > set-after-unset = should be unset (.hg/hgrc)
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
61 > %unset set-after-unset
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
62 > set-after-unset = should be set (.hg/hgrc)
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
63 > EOF
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
64
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
65 $ hg showconfig unsettest
7d82ad4b3727 config: discard "%unset" values defined in the other files read in previously
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19086
diff changeset
66 unsettest.set-after-unset=should be set (.hg/hgrc)