t7810: avoid unportable use of "echo"
Michael J Gruber noticed that under /bin/dash this test failed (as is expected -- \n in the string can be interpreted by the command), while it passed with bash. We probably could work it around by using backquote in front of it, but it is safer and more readable to avoid "echo" altogether in a case like this. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jun 20, 2011 at 14:49 UTC
93d5e0c2087916941934b1e55c979c52f5af3f20
1 file changed
+3
-3
t/t7810-grep.sh
+3
-3
@@ -658,9 +658,9 @@ test_expect_success LIBPCRE 'grep -P -v pattern' '
658
'
659
660
test_expect_success LIBPCRE 'grep -P -i pattern' '
661
- {
662
- echo "hello.c: printf(\"Hello world.\n\");"
663
- } >expected &&
661
+ cat >expected <<-EOF &&
662
+ hello.c: printf("Hello world.\n");
663
+ EOF
664
git grep -P -i "PRINTF\([^\d]+\)" hello.c >actual &&
665
test_cmp expected actual
666
'