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

[PATCH v2 1/2] t4151: consolidate multiple calls to test_i18ngrep

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Feb 24, 2018, 01:20 UTC
Message-ID
<098550c4-e4d0-87a6-16f3-bbb13e2ad163@ramsayjones.plus.com>

Attempting to grep the output of test_i18ngrep will not work under a poison build, since the output is (almost) guaranteed not to have the string you are looking for. In this case, we have a test_i18ngrep call which attempts to filter the contents of a file, which was itself the result of a call to test_i18ngrep. In this case, we can achieve the same effect with a single call to test_i18ngrep (without creating the intermediate file), since the second regular expression can be used without change to filter the original input.

Also, replace a call to test_i18ncmp with test_cmp, since the content being compared is not subject to i18n anyway.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
 t/t4151-am-abort.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh
index 9473c2779..16432781d 100755
--- a/t/t4151-am-abort.sh
+++ b/t/t4151-am-abort.sh
@@ -46,9 +46,8 @@ do
 
 	test_expect_success "am$with3 --skip continue after failed am$with3" '
 		test_must_fail git am$with3 --skip >output &&
-		test_i18ngrep "^Applying" output >output.applying &&
-		test_i18ngrep "^Applying: 6$" output.applying &&
-		test_i18ncmp file-2-expect file-2 &&
+		test_i18ngrep "^Applying: 6$" output &&
+		test_cmp file-2-expect file-2 &&
 		test ! -f .git/MERGE_RR
 	'
 
-- 
2.16.0
Message 1 of 1 in “t4151: consolidate multiple calls to test_i18ngrep”
  1. 1/2 t4151: consolidate multiple calls to test_i18ngrepRamsay Jones, Feb 24, 2018

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.