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

[PATCH] t/t9001: use egrep when regular expressions are involved

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Jun 28, 2010, 22:46 UTC
Message-ID
<_N29gMstbxoMxTYcMQECjVdQPNE8os2yuDS4zgtxw7xeZoP8pckXHsBNVLrsPCEEMmoFN-o4mDU@cipher.nrlssc.navy.mil>
From: Brandon Casey <drafnel@gmail.com>

Supplying backslashed, extended regular expressions to grep is not portable. Use egrep instead.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t9001-send-email.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 37610db..23597cc 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -943,7 +943,7 @@ test_expect_success 'asks about and fixes 8bit encodings' '
 	grep "do not declare a Content-Transfer-Encoding" stdout &&
 	grep email-using-8bit stdout &&
 	grep "Which 8bit encoding" stdout &&
-	grep "Content\\|MIME" msgtxt1 >actual &&
+	egrep "Content|MIME" msgtxt1 >actual &&
 	test_cmp actual content-type-decl
 '
 
@@ -954,7 +954,7 @@ test_expect_success 'sendemail.8bitEncoding works' '
 	git send-email --from=author@example.com --to=nobody@example.com \
 			--smtp-server="$(pwd)/fake.sendmail" \
 			email-using-8bit >stdout &&
-	grep "Content\\|MIME" msgtxt1 >actual &&
+	egrep "Content|MIME" msgtxt1 >actual &&
 	test_cmp actual content-type-decl
 '
 
@@ -966,7 +966,7 @@ test_expect_success '--8bit-encoding overrides sendemail.8bitEncoding' '
 			--smtp-server="$(pwd)/fake.sendmail" \
 			--8bit-encoding=UTF-8 \
 			email-using-8bit >stdout &&
-	grep "Content\\|MIME" msgtxt1 >actual &&
+	egrep "Content|MIME" msgtxt1 >actual &&
 	test_cmp actual content-type-decl
 '
 
-- 
1.6.6.2
Message 1 of 1 in “t/t9001: use egrep when regular expressions are involved”
  1. t/t9001: use egrep when regular expressions are involvedBrandon Casey, Jun 28, 2010

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.