From: Ævar Arnfjörð Bjarmason Date: Tue, 20 Jul 2010 18:25:49 GMT Subject: Re: [PATCH] t/t3700: convert two uses of negation operator '!' to use test_must_fail Message-ID: In-Reply-To: On Tue, Jul 20, 2010 at 16:32, Brandon Casey wrote: >>> This was noticed because the second use of '!' does not include a space >>> between the '!' and the opening parens.  Ksh interprets this as follows: >>> >>>   !(pattern-list) >>>      Matches anything except one of the given patterns. >>> >>> Ksh performs a file glob using the pattern-list and then tries to execute >>> the first file in the list.  If a space is added between the '!' and the >>> open parens, then Ksh will not interpret it as a pattern list, but in this >>> case, it is preferred to use test_must_fail, so lets do so. >> >> Isn't this a completely seperate thing? Was this test really the only >> bit in the test suite that did "!foo" instead of "! foo" ? > > This was the only instance of "!()" that was failing for me.  I didn't > look before, but now that I have, there is another instance of "!()" in > t5541 that should be fixed.  t5541 hasn't caused a problem for me because > GIT_TEST_HTTPD must be set in order to enable it, and I haven't done so. > >> Does the test pass for you if you just: > > Yes. > >>     @@ -281,7 +281,7 @@ add 'track-this' >>      EOF >> >>      test_expect_success 'git add --dry-run --ignore-missing of >> non-existing file' ' >>     -       !(git add --dry-run --ignore-missing track-this >> ignored-file >actual 2>&1) && >>     +       ! (git add --dry-run --ignore-missing track-this >> ignored-file >actual 2>&1) && >>            test_cmp expect actual >>      ' A seperate patch to clean up those two + doc patch to the "Do's, don'ts & things to keep in mind" section in t/README would be really useful IMO. I had no idea that "!cmd" was an issue no ksh.