From 76642ccec813a1cc2ca1bf9539abeb5f17764808 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Fri, 13 Apr 2012 23:45:31 -0500 Subject: test: do not rely on US English tracking-info messages When v1.7.9.2~28^2 (2012-02-02) marked "Your branch is behind" and friends for translation, it forgot to adjust tests not to check those messages when tests are being run with git configured to write its output in another language. With this patch applied, t2020 and t6040 pass again with GETTEXT_POISON=YesPlease. Signed-off-by: Jonathan Nieder Explained-by: Jeff King Signed-off-by: Junio C Hamano --- t/t2020-checkout-detach.sh | 2 +- t/t6040-tracking-info.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 't') diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh index 068fba4c8e..b37ce25c42 100755 --- a/t/t2020-checkout-detach.sh +++ b/t/t2020-checkout-detach.sh @@ -148,7 +148,7 @@ test_expect_success 'tracking count is accurate after orphan check' ' git config branch.child.merge refs/heads/master && git checkout child^ && git checkout child >stdout && - test_cmp expect stdout + test_i18ncmp expect stdout ' test_done diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh index 19272bc551..ec2b516c3f 100755 --- a/t/t6040-tracking-info.sh +++ b/t/t6040-tracking-info.sh @@ -71,13 +71,13 @@ test_expect_success 'checkout' ' ( cd test && git checkout b1 ) >actual && - grep "have 1 and 1 different" actual + test_i18ngrep "have 1 and 1 different" actual ' test_expect_success 'checkout with local tracked branch' ' git checkout master && git checkout follower >actual && - grep "is ahead of" actual + test_i18ngrep "is ahead of" actual ' test_expect_success 'status' ' @@ -87,14 +87,14 @@ test_expect_success 'status' ' # reports nothing to commit test_must_fail git commit --dry-run ) >actual && - grep "have 1 and 1 different" actual + test_i18ngrep "have 1 and 1 different" actual ' test_expect_success 'fail to track lightweight tags' ' git checkout master && git tag light && test_must_fail git branch --track lighttrack light >actual && - test_must_fail grep "set up to track" actual && + test_i18ngrep ! "set up to track" actual && test_must_fail git checkout lighttrack ' @@ -102,7 +102,7 @@ test_expect_success 'fail to track annotated tags' ' git checkout master && git tag -m heavy heavy && test_must_fail git branch --track heavytrack heavy >actual && - test_must_fail grep "set up to track" actual && + test_i18ngrep ! "set up to track" actual && test_must_fail git checkout heavytrack ' -- cgit v1.2.1 From b1f5b7839c3bce2accda8b70e03ccc62ad778dd9 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Fri, 13 Apr 2012 23:46:18 -0500 Subject: test: use test_i18ncmp for "Patch format detection failed" message v1.7.8.5~2 (am: don't infloop for an empty input file, 2012-02-25) added a check for the human-readable message "Patch format detection failed." but we forgot to suppress that check when running tests with git configured to write output in another language. Noticed by running tests with GETTEXT_POISON=YesPlease. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- t/t4150-am.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/t4150-am.sh b/t/t4150-am.sh index ccc0280f52..ebb4a26a0d 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -527,7 +527,7 @@ test_expect_success 'am empty-file does not infloop' ' test_tick && { git am empty-file > actual 2>&1 && false || :; } && echo Patch format detection failed. >expected && - test_cmp expected actual + test_i18ncmp expected actual ' test_done -- cgit v1.2.1 From 948065a4837f006c5c84ee1288cf15f1a56d93f2 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Fri, 13 Apr 2012 23:48:13 -0500 Subject: test: am of empty patch should not succeed The "git am empty" test uses the construct git am empty-file && false || : which unconditionally returns true. Use test_must_fail instead, which also has the benefit of noticing if "git am" has segfaulted. While at it, tighten the test to check that the diagnostic appears on stderr and not stdout. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- t/t4150-am.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/t4150-am.sh b/t/t4150-am.sh index ebb4a26a0d..cdafd7e7c1 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -525,7 +525,7 @@ test_expect_success 'am empty-file does not infloop' ' git reset --hard && touch empty-file && test_tick && - { git am empty-file > actual 2>&1 && false || :; } && + test_must_fail git am empty-file 2>actual && echo Patch format detection failed. >expected && test_i18ncmp expected actual ' -- cgit v1.2.1