Re: EOF test fixes (t5615/t7004)
Jan Paluswrites: > 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.sh2017-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 > ' Ouch. These shouldn't even have passed our review. Thanks for spotting.
Re: EOF test fixes (t5615/t7004)
On Wed, Mar 22, 2017 at 10:35 AM, Jan Paluswrote: > 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. Thanks for catching these bugs! Please have a look at Documentation/SubmittingPatches. (the most important thing is the "Sign-off-by" line indicating you are legally permitted to send such a patch; for one-off patches the format can be negotiated, but it is easier for maintainers to take the proper format.) This email conveys the actual problem very well, so only a little change is needed to make it a proper commit message. (c.f. git clone git://git.kernel.org/pub/scm/git/git.git/ && git -C git log) Thanks, Stefan
EOF test fixes (t5615/t7004)
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.sh2017-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 '