git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 3/6] completion: simplify tests using test_completion_long()

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 11, 2012, 14:35 UTC
Message-ID
<1352644558-9410-4-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1352644558-9410-1-git-send-email-felipe.contreras@gmail.com>
No need to duplicate that functionality.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/t9902-completion.sh | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index aff7e44..204c92a 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -172,7 +172,7 @@ test_expect_success 'basic' '
 '
 
 test_expect_success 'double dash "git" itself' '
-	sed -e "s/Z$//" >expected <<-\EOF &&
+	test_completion_long "git --" <<-\EOF
 	--paginate Z
 	--no-pager Z
 	--git-dir=
@@ -187,11 +187,10 @@ test_expect_success 'double dash "git" itself' '
 	--no-replace-objects Z
 	--help Z
 	EOF
-	test_completion "git --"
 '
 
 test_expect_success 'double dash "git checkout"' '
-	sed -e "s/Z$//" >expected <<-\EOF &&
+	test_completion_long "git checkout --" <<-\EOF
 	--quiet Z
 	--ours Z
 	--theirs Z
@@ -202,17 +201,15 @@ test_expect_success 'double dash "git checkout"' '
 	--orphan Z
 	--patch Z
 	EOF
-	test_completion "git checkout --"
 '
 
 test_expect_success 'general options' '
 	test_completion "git --ver" "--version " &&
 	test_completion "git --hel" "--help " &&
-	sed -e "s/Z$//" >expected <<-\EOF &&
+	test_completion_long "git --exe" <<-\EOF &&
 	--exec-path Z
 	--exec-path=
 	EOF
-	test_completion "git --exe" &&
 	test_completion "git --htm" "--html-path " &&
 	test_completion "git --pag" "--paginate " &&
 	test_completion "git --no-p" "--no-pager " &&
-- 
1.8.0
Previous: Felipe ContrerasNext: Felipe Contreras
Message 7 of 16 in “completion: test consolidations”
  1. 0/6 completion: test consolidationsFelipe Contreras, Nov 11, 2012
  2. 1/6 completion: add comment for test_completion()Felipe Contreras, Nov 11, 2012
  3. SZEDER GáborNov 16, 2012
  4. Felipe ContrerasNov 16, 2012
  5. Felipe ContrerasNov 16, 2012
  6. 2/6 completion: standardize final space marker in testsFelipe Contreras, Nov 11, 2012
  7. 3/6 completion: simplify tests using test_completion_long()Felipe Contreras, Nov 11, 2012
  8. 4/6 completion: consolidate test_completion*() testsFelipe Contreras, Nov 11, 2012
  9. Junio C HamanoNov 16, 2012
  10. Felipe ContrerasNov 17, 2012
  11. 5/6 completion: refactor __gitcomp related testsFelipe Contreras, Nov 11, 2012
  12. Junio C HamanoNov 16, 2012
  13. Felipe ContrerasNov 16, 2012
  14. SZEDER GáborNov 16, 2012
  15. Junio C HamanoNov 16, 2012
  16. 6/6 completion: simplify __gitcomp() test helperFelipe Contreras, Nov 11, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.