1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-02 07:06:10 +02:00

tests: fix negated test_i18ngrep calls

The helper function test_i18ngrep pretends that it found the expected
results when it is running under GETTEXT_POISON. For this reason, it must
not be used negated like so

   ! test_i18ngrep foo bar

because the test case would fail under GETTEXT_POISON. The function offers
a special syntax to test that a pattern is *not* found:

   test_i18ngrep ! foo bar

Convert incorrect uses to this syntax.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Sixt 2014-08-13 21:30:11 +02:00 committed by Junio C Hamano
parent 67de23ddb1
commit 41ca19b6a6
3 changed files with 6 additions and 6 deletions

View File

@ -52,15 +52,15 @@ do
echo "*.java diff=$p" >.gitattributes && echo "*.java diff=$p" >.gitattributes &&
test_expect_code 1 git diff --no-index \ test_expect_code 1 git diff --no-index \
A.java B.java 2>msg && A.java B.java 2>msg &&
! test_i18ngrep fatal msg && test_i18ngrep ! fatal msg &&
! test_i18ngrep error msg test_i18ngrep ! error msg
' '
test_expect_success "builtin $p wordRegex pattern compiles" ' test_expect_success "builtin $p wordRegex pattern compiles" '
echo "*.java diff=$p" >.gitattributes && echo "*.java diff=$p" >.gitattributes &&
test_expect_code 1 git diff --no-index --word-diff \ test_expect_code 1 git diff --no-index --word-diff \
A.java B.java 2>msg && A.java B.java 2>msg &&
! test_i18ngrep fatal msg && test_i18ngrep ! fatal msg &&
! test_i18ngrep error msg test_i18ngrep ! error msg
' '
done done

View File

@ -145,7 +145,7 @@ test_expect_success 'exit when p4 fails to produce marshaled output' '
test_expect_code 1 git p4 clone --dest="$git" //depot >errs 2>&1 test_expect_code 1 git p4 clone --dest="$git" //depot >errs 2>&1
) && ) &&
cat errs && cat errs &&
! test_i18ngrep Traceback errs test_i18ngrep ! Traceback errs
' '
# Hide a file from p4d, make sure we catch its complaint. This won't fail in # Hide a file from p4d, make sure we catch its complaint. This won't fail in

View File

@ -404,7 +404,7 @@ test_expect_success 'submit --prepare-p4-only' '
git p4 submit --prepare-p4-only >out && git p4 submit --prepare-p4-only >out &&
test_i18ngrep "prepared for submission" out && test_i18ngrep "prepared for submission" out &&
test_i18ngrep "must be deleted" out && test_i18ngrep "must be deleted" out &&
! test_i18ngrep "everything below this line is just the diff" out test_i18ngrep ! "everything below this line is just the diff" out
) && ) &&
( (
cd "$cli" && cd "$cli" &&