Skip to content

Commit

Permalink
help tests: add test for --config output
Browse files Browse the repository at this point in the history
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 <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
avar authored and gitster committed Sep 23, 2021
1 parent 9856ea6 commit ff76fc8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions t/t0012-help.sh
Expand Up @@ -77,6 +77,19 @@ test_expect_success 'git help -g' '
test_i18ngrep "^ tutorial " help.output
'

test_expect_success 'git help -c' '
git help -c >help.output &&
cat >expect <<-\EOF &&
'\''git help config'\'' for more information
EOF
grep -v -E \
-e "^[^.]+\.[^.]+$" \
-e "^[^.]+\.[^.]+\.[^.]+$" \
help.output >actual &&
test_cmp expect actual
'

test_expect_success 'generate builtin list' '
git --list-cmds=builtins >builtins
'
Expand Down

0 comments on commit ff76fc8

Please sign in to comment.