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

[PATCH 2/2] completion: simplify __gitcomp test helper

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Oct 22, 2012, 01:39 UTC
Message-ID
<1350869941-22485-3-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1350869941-22485-1-git-send-email-felipe.contreras@gmail.com>
By using print_comp as suggested by SZEDER Gábor.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/t9902-completion.sh | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 1c6952a..2e7fc06 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -74,15 +74,12 @@ newline=$'\n'
 
 test_gitcomp ()
 {
+	local -a COMPREPLY &&
 	sed -e 's/Z$//' > expected &&
-	(
-		local -a COMPREPLY &&
-		cur="$1" &&
-		shift &&
-		__gitcomp "$@" &&
-		IFS="$newline" &&
-		echo "${COMPREPLY[*]}" > out
-	) &&
+	cur="$1" &&
+	shift &&
+	__gitcomp "$@" &&
+	print_comp &&
 	test_cmp expected out
 }
 
-- 
1.8.0
Previous: Felipe ContrerasNext: SZEDER Gábor
Message 5 of 7 in “completion: test simplifications”
  1. 0/2 completion: test simplificationsFelipe Contreras, Oct 22, 2012
  2. 1/2 completion: refactor __gitcomp related testsFelipe Contreras, Oct 22, 2012
  3. SZEDER GáborOct 30, 2012
  4. Felipe ContrerasOct 30, 2012
  5. 2/2 completion: simplify __gitcomp test helperFelipe Contreras, Oct 22, 2012
  6. SZEDER GáborOct 30, 2012
  7. Felipe ContrerasOct 30, 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.