diff mbox series

[3/6] help tests: add test for --config output

Message ID patch-3.6-d0a8045c9ed-20210908T151949Z-avarab@gmail.com (mailing list archive)
State Superseded
Headers show
Series help: fix usage nits & bugs, completion shellscript->C | expand

Commit Message

Ævar Arnfjörð Bjarmason Sept. 8, 2021, 3:24 p.m. UTC
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.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t0012-help.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/t/t0012-help.sh b/t/t0012-help.sh
index 6e01da614f0..94d1f481c8b 100755
--- a/t/t0012-help.sh
+++ b/t/t0012-help.sh
@@ -78,6 +78,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
 '