Skip to content

Commit 41ca19b

Browse files
j6tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 67de23d commit 41ca19b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

t/t4018-diff-funcname.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ do
5252
echo "*.java diff=$p" >.gitattributes &&
5353
test_expect_code 1 git diff --no-index \
5454
A.java B.java 2>msg &&
55-
! test_i18ngrep fatal msg &&
56-
! test_i18ngrep error msg
55+
test_i18ngrep ! fatal msg &&
56+
test_i18ngrep ! error msg
5757
'
5858
test_expect_success "builtin $p wordRegex pattern compiles" '
5959
echo "*.java diff=$p" >.gitattributes &&
6060
test_expect_code 1 git diff --no-index --word-diff \
6161
A.java B.java 2>msg &&
62-
! test_i18ngrep fatal msg &&
63-
! test_i18ngrep error msg
62+
test_i18ngrep ! fatal msg &&
63+
test_i18ngrep ! error msg
6464
'
6565
done
6666

t/t9800-git-p4-basic.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ test_expect_success 'exit when p4 fails to produce marshaled output' '
145145
test_expect_code 1 git p4 clone --dest="$git" //depot >errs 2>&1
146146
) &&
147147
cat errs &&
148-
! test_i18ngrep Traceback errs
148+
test_i18ngrep ! Traceback errs
149149
'
150150

151151
# Hide a file from p4d, make sure we catch its complaint. This won't fail in

t/t9807-git-p4-submit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ test_expect_success 'submit --prepare-p4-only' '
404404
git p4 submit --prepare-p4-only >out &&
405405
test_i18ngrep "prepared for submission" out &&
406406
test_i18ngrep "must be deleted" out &&
407-
! test_i18ngrep "everything below this line is just the diff" out
407+
test_i18ngrep ! "everything below this line is just the diff" out
408408
) &&
409409
(
410410
cd "$cli" &&

0 commit comments

Comments
 (0)