From: drafnel@gmail.com
To: gitster@pobox.com
Cc: git@vger.kernel.org, Brandon Casey <drafnel@gmail.com>
Subject: [PATCH maint 1/2] t4018-diff-funcname: rework negated last expression test
Date: Wed, 15 Oct 2008 19:58:49 -0500 [thread overview]
Message-ID: <13723998.1224118688113.JavaMail.teamon@b307.teamon.com> (raw)
In-Reply-To: <7vljwpr6lr.fsf@gitster.siamese.dyndns.org>
This test used the non-zero exit status of 'git diff' to indicate that a
negated funcname pattern, when placed last, was correctly rejected.
The problem with this is that 'git diff' always returns non-zero if it
finds differences in the files it is comparing, and the files must
contain differences in order to trigger the funcname pattern codepath.
Instead of checking for non-zero exit status, make sure the expected
error message is printed.
Signed-off-by: Brandon Casey <drafnel@gmail.com>
---
This is not really a series, but I expect you'll apply both, so this
seems easier for both of us.
-brandon
t/t4018-diff-funcname.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 99fff97..72076ec 100755
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
@@ -65,7 +65,8 @@ test_expect_success 'custom pattern' '
test_expect_success 'last regexp must not be negated' '
git config diff.java.funcname "!static" &&
- test_must_fail git diff --no-index Beer.java Beer-correct.java
+ git diff --no-index Beer.java Beer-correct.java 2>&1 |
+ grep "fatal: Last expression must not be negated:"
'
test_expect_success 'alternation in pattern' '
--
1.6.0.2.101.gb844
next prev parent reply other threads:[~2008-10-16 1:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-14 22:08 What's in git.git (Oct 2008, #03; Tue, 14) Junio C Hamano
2008-10-15 15:35 ` Brandon Casey
2008-10-15 17:25 ` Mike Ralphson
2008-10-15 19:38 ` Junio C Hamano
2008-10-15 20:20 ` Shawn O. Pearce
2008-10-15 20:26 ` Junio C Hamano
2008-10-15 20:36 ` Shawn O. Pearce
2008-10-16 0:58 ` drafnel [this message]
[not found] ` <1224118730-24711-1-git-send-email-drafnel@gmail.com>
2008-10-16 0:58 ` [PATCH maint 2/2] t4018-diff-funcname: demonstrate end of line funcname matching flaw drafnel
2008-10-16 10:08 ` What's in git.git (Oct 2008, #03; Tue, 14) Jeff King
2008-10-16 15:21 ` Brandon Casey
2008-10-16 15:37 ` Pieter de Bie
2008-10-17 7:02 ` Arjen Laarhoven
2008-10-24 2:44 ` Junio C Hamano
2008-10-17 9:53 ` Jeff King
2008-10-17 23:58 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=13723998.1224118688113.JavaMail.teamon@b307.teamon.com \
--to=drafnel@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).