completion: simplify tests using test_completion_long()

No need to duplicate that functionality.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Felipe Contreras
2012-11-11 15:35:55 +01:00
committed by Junio C Hamano
parent 43ea081235
commit a1be444d09

View File

@ -172,7 +172,7 @@ test_expect_success 'basic' '
' '
test_expect_success 'double dash "git" itself' ' test_expect_success 'double dash "git" itself' '
sed -e "s/Z$//" >expected <<-\EOF && test_completion_long "git --" <<-\EOF
--paginate Z --paginate Z
--no-pager Z --no-pager Z
--git-dir= --git-dir=
@ -187,11 +187,10 @@ test_expect_success 'double dash "git" itself' '
--no-replace-objects Z --no-replace-objects Z
--help Z --help Z
EOF EOF
test_completion "git --"
' '
test_expect_success 'double dash "git checkout"' ' test_expect_success 'double dash "git checkout"' '
sed -e "s/Z$//" >expected <<-\EOF && test_completion_long "git checkout --" <<-\EOF
--quiet Z --quiet Z
--ours Z --ours Z
--theirs Z --theirs Z
@ -202,17 +201,15 @@ test_expect_success 'double dash "git checkout"' '
--orphan Z --orphan Z
--patch Z --patch Z
EOF EOF
test_completion "git checkout --"
' '
test_expect_success 'general options' ' test_expect_success 'general options' '
test_completion "git --ver" "--version " && test_completion "git --ver" "--version " &&
test_completion "git --hel" "--help " && test_completion "git --hel" "--help " &&
sed -e "s/Z$//" >expected <<-\EOF && test_completion_long "git --exe" <<-\EOF &&
--exec-path Z --exec-path Z
--exec-path= --exec-path=
EOF EOF
test_completion "git --exe" &&
test_completion "git --htm" "--html-path " && test_completion "git --htm" "--html-path " &&
test_completion "git --pag" "--paginate " && test_completion "git --pag" "--paginate " &&
test_completion "git --no-p" "--no-pager " && test_completion "git --no-p" "--no-pager " &&