test-check-config.t
47 lines
| 1.5 KiB
| text/troff
|
Tads3Lexer
/ tests / test-check-config.t
|
r27368 | #require test-repo | ||
|
r29219 | $ . "$TESTDIR/helpers-testrepo.sh" | ||
|
r32846 | |||
Sanity check check-config.py | ||||
$ cat > testfile.py << EOF | ||||
> # Good | ||||
> foo = ui.config('ui', 'username') | ||||
> # Missing | ||||
> foo = ui.config('ui', 'doesnotexist') | ||||
> # Missing different type | ||||
> foo = ui.configint('ui', 'missingint') | ||||
> # Missing with default value | ||||
> foo = ui.configbool('ui', 'missingbool1', default=True) | ||||
> foo = ui.configbool('ui', 'missingbool2', False) | ||||
|
r33192 | > # Inconsistent values for defaults. | ||
> foo = ui.configint('ui', 'intdefault', default=1) | ||||
> foo = ui.configint('ui', 'intdefault', default=42) | ||||
> # Can suppress inconsistent value error | ||||
> foo = ui.configint('ui', 'intdefault2', default=1) | ||||
> # inconsistent config: ui.intdefault2 | ||||
> foo = ui.configint('ui', 'intdefault2', default=42) | ||||
|
r32846 | > EOF | ||
$ cat > files << EOF | ||||
> mercurial/help/config.txt | ||||
> $TESTTMP/testfile.py | ||||
> EOF | ||||
|
r27368 | $ cd "$TESTDIR"/.. | ||
|
r32940 | $ $PYTHON contrib/check-config.py < $TESTTMP/files | ||
|
r33192 | foo = ui.configint('ui', 'intdefault', default=42) | ||
conflict on ui.intdefault: ('int', '42') != ('int', '1') | ||||
|
r35394 | at $TESTTMP/testfile.py:12: | ||
|
r32846 | undocumented: ui.doesnotexist (str) | ||
|
r33192 | undocumented: ui.intdefault (int) [42] | ||
undocumented: ui.intdefault2 (int) [42] | ||||
|
r32846 | undocumented: ui.missingbool1 (bool) [True] | ||
undocumented: ui.missingbool2 (bool) | ||||
undocumented: ui.missingint (int) | ||||
|
r27368 | New errors are not allowed. Warnings are strongly discouraged. | ||
|
r33199 | $ testrepohg files "set:(**.py or **.txt) - tests/**" | sed 's|\\|/|g' | | ||
|
r32940 | > $PYTHON contrib/check-config.py | ||