Skip to content

Commit ff76fc8

Browse files
avargitster
authored andcommitted
help tests: add test for --config output
Add a missing test for checking what the --config output added in ac68a93fd2 (help: add --config to list all available config, 2018-05-26) looks like. We should not be emitting anything except config variables and the brief usage information at the end here. The second test regexp here might not match three-level variables in general, as their second level could contain ".", but in this case we're always emitting what we extract from the documentation, so it's all strings like: foo.<name>.bar If we did introduce something like variable example content here we'd like this to break, since we'd then be likely to break the git-completion.bash. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9856ea6 commit ff76fc8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

t/t0012-help.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ test_expect_success 'git help -g' '
7777
test_i18ngrep "^ tutorial " help.output
7878
'
7979

80+
test_expect_success 'git help -c' '
81+
git help -c >help.output &&
82+
cat >expect <<-\EOF &&
83+
84+
'\''git help config'\'' for more information
85+
EOF
86+
grep -v -E \
87+
-e "^[^.]+\.[^.]+$" \
88+
-e "^[^.]+\.[^.]+\.[^.]+$" \
89+
help.output >actual &&
90+
test_cmp expect actual
91+
'
92+
8093
test_expect_success 'generate builtin list' '
8194
git --list-cmds=builtins >builtins
8295
'

0 commit comments

Comments
 (0)