EOF test fixes (t5615/t7004)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

attached patch fixes 2 out of 3 tests failing in my env -- missing EOF,
incorrectly placed "&&" after EOF. One test seems to be incorrect as it
fails even after fixing. I suspect the main difference between my env and
others is in shell used -- mksh in my case and probably bash in others.
Looks like bash has a nasty behavior when it encounters syntax error:

$ cat test.sh
cat >/dev/null <<-\EOF
tagname : forged-tag
EOF &&
echo foo

$ bash test.sh && echo success || echo failed
test.sh: line 4: warning: here-document at line 1 delimited by
end-of-file (wanted `EOF')
success

# notice no "foo" printed

$ mksh test.sh && echo success || echo failed    
test.sh[5]: here document 'EOF' unclosed
failed

Test that fails even after fixing EOFs:
t7004-tag.sh:verifying a forged tag with --format fail and format accordingly

Note that I'm not subscribed to mailing list so in case of any questions
please mail me directly.


Regards
Jan
diff -urN git-2.11.1.orig/t/t5615-alternate-env.sh git-2.11.1/t/t5615-alternate-env.sh
--- git-2.11.1.orig/t/t5615-alternate-env.sh	2017-02-03 02:24:45.115143042 +0100
+++ git-2.11.1/t/t5615-alternate-env.sh	2017-02-03 02:24:58.081809318 +0100
@@ -77,6 +77,7 @@
 	check_obj "$quoted:$unquoted" <<-EOF
 	$one blob
 	$two blob
+	EOF
 '
 
 test_expect_success !MINGW 'broken quoting falls back to interpreting raw' '
diff -ur git-2.12.0.orig/t/t7004-tag.sh git-2.12.0/t/t7004-tag.sh
--- git-2.12.0.orig/t/t7004-tag.sh	2017-02-25 14:10:53.059367179 +0100
+++ git-2.12.0/t/t7004-tag.sh	2017-02-25 14:11:45.105827700 +0100
@@ -880,17 +880,17 @@
 '
 
 test_expect_success 'verifying a proper tag with --format pass and format accordingly' '
-	cat >expect <<-\EOF
+	cat >expect <<-\EOF &&
 	tagname : signed-tag
-	EOF &&
+	EOF
 	git tag -v --format="tagname : %(tag)" "signed-tag" >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'verifying a forged tag with --format fail and format accordingly' '
-	cat >expect <<-\EOF
+	cat >expect <<-\EOF &&
 	tagname : forged-tag
-	EOF &&
+	EOF
 	test_must_fail git tag -v --format="tagname : %(tag)" "forged-tag" >actual &&
 	test_cmp expect actual
 '

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]