diff options
author | Brandon Casey <drafnel@gmail.com> | 2008-10-15 19:58:49 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-10-16 08:31:56 -0700 |
commit | 16b26725368f7b80711d9a631029fbb869646f9c (patch) | |
tree | 60ff5c863fcf62a24cb5093e0c3fec4a955753bc | |
parent | 6c2a6022dbc5879f5d6c267925408e484be6214a (diff) | |
download | git-16b26725368f7b80711d9a631029fbb869646f9c.tar.gz git-16b26725368f7b80711d9a631029fbb869646f9c.tar.xz |
t4018-diff-funcname: rework negated last expression test
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-x | 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 99fff973e..72076eca8 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' ' |