All of lore.kernel.org
 help / color / mirror / Atom feed
* EOF test fixes (t5615/t7004)
@ 2017-03-22 17:35 Jan Palus
  2017-03-22 18:28 ` EOF test fixes (t7030/t7406) Jan Palus
                   ` (3 more replies)
  0 siblings, 4 replies; 46+ messages in thread
From: Jan Palus @ 2017-03-22 17:35 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

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

[-- Attachment #2: git-core-tests.patch --]
[-- Type: text/plain, Size: 1197 bytes --]

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
 '

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2017-03-24 18:16 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-22 17:35 EOF test fixes (t5615/t7004) Jan Palus
2017-03-22 18:28 ` EOF test fixes (t7030/t7406) Jan Palus
2017-03-22 18:47 ` EOF test fixes (t5615/t7004) Stefan Beller
2017-03-22 19:43 ` Junio C Hamano
2017-03-22 20:08 ` [PATCH 0/3] fix "here-doc" syntax errors Junio C Hamano
2017-03-22 20:08   ` [PATCH 1/3] t5615: fix a here-doc syntax error Junio C Hamano
2017-03-22 21:02     ` Jeff King
2017-03-22 20:08   ` [PATCH 2/3] t7406: fix here-doc syntax errors Junio C Hamano
2017-03-22 21:07     ` Jeff King
2017-03-22 21:32       ` Stefan Beller
2017-03-22 21:39         ` Jeff King
2017-03-22 21:49           ` [PATCH] t7406: correct test case for submodule-update initial population Stefan Beller
2017-03-22 21:59             ` Jeff King
2017-03-22 22:07               ` Stefan Beller
2017-03-22 22:09                 ` Jeff King
2017-03-22 22:14                 ` Jonathan Nieder
2017-03-22 22:12               ` Junio C Hamano
2017-03-22 22:24                 ` Jeff King
2017-03-22 22:28                   ` Stefan Beller
2017-03-22 21:34       ` [PATCH 2/3] t7406: fix here-doc syntax errors Junio C Hamano
2017-03-22 20:08   ` [PATCH 3/3] t7004, t7030: " Junio C Hamano
2017-03-22 21:10     ` Jeff King
2017-03-22 21:43       ` Santiago Torres
2017-03-22 22:04         ` Jeff King
2017-03-22 22:04       ` Junio C Hamano
2017-03-22 22:15         ` Santiago Torres
2017-03-22 22:22           ` Jeff King
2017-03-22 22:34             ` Santiago Torres
2017-03-22 22:41               ` Jeff King
2017-03-22 22:47                 ` Junio C Hamano
2017-03-22 22:51                 ` Santiago Torres
2017-03-23 22:00                   ` Junio C Hamano
2017-03-23 22:28                     ` Santiago Torres
2017-03-23 23:49                     ` Jeff King
2017-03-24 16:45                       ` Junio C Hamano
2017-03-24 16:49                         ` Jeff King
2017-03-24 18:00                           ` Jeff King
2017-03-24 18:04                           ` Junio C Hamano
2017-03-24 18:16                             ` Jeff King
2017-03-22 22:38             ` Junio C Hamano
2017-03-22 22:40   ` [PATCH 0/3] fix "here-doc" " Jan Palus
2017-03-23  2:12   ` [PATCH] tests: lint for run-away here-doc Junio C Hamano
2017-03-23  5:43     ` [PATCH v2] " Junio C Hamano
2017-03-24  1:29       ` Jonathan Nieder
2017-03-24  2:45         ` Junio C Hamano
2017-03-24  3:59       ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.