Skip to content

Commit 6ddc97c

Browse files
mehul2029gitster
authored andcommitted
t5520: use better test to check stderr output
Checking stderr output using test_i18ncmp may lead to test failure as some shells write trace output to stderr when run under 'set -x'. Use test_i18ngrep instead of test_i18ncmp. Signed-off-by: Mehul Jain <[email protected]> Reviewed-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eff960b commit 6ddc97c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

t/t5520-pull.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,13 @@ test_expect_success 'pull --rebase --no-autostash & rebase.autostash unset' '
317317
'
318318

319319
test_expect_success 'pull --autostash (without --rebase) should error out' '
320-
test_must_fail git pull --autostash . copy 2>actual &&
321-
echo "fatal: --[no-]autostash option is only valid with --rebase." >expect &&
322-
test_i18ncmp actual expect
320+
test_must_fail git pull --autostash . copy 2>err &&
321+
test_i18ngrep "only valid with --rebase" err
323322
'
324323

325324
test_expect_success 'pull --no-autostash (without --rebase) should error out' '
326-
test_must_fail git pull --no-autostash . copy 2>actual &&
327-
echo "fatal: --[no-]autostash option is only valid with --rebase." >expect &&
328-
test_i18ncmp actual expect
325+
test_must_fail git pull --no-autostash . copy 2>err &&
326+
test_i18ngrep "only valid with --rebase" err
329327
'
330328

331329
test_expect_success 'pull.rebase' '

0 commit comments

Comments
 (0)