Skip to content

Commit

Permalink
Merge branch 'rj/test-i18ngrep'
Browse files Browse the repository at this point in the history
Test updates.

* rj/test-i18ngrep:
  t5536: simplify checking of messages output to stderr
  t4151: consolidate multiple calls to test_i18ngrep
  • Loading branch information
gitster committed Mar 14, 2018
2 parents 787aa97 + 51b74b5 commit d92a015
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
5 changes: 2 additions & 3 deletions t/t4151-am-abort.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ do

test_expect_success "am$with3 --skip continue after failed am$with3" '
test_must_fail git am$with3 --skip >output &&
test_i18ngrep "^Applying" output >output.applying &&
test_i18ngrep "^Applying: 6$" output.applying &&
test_i18ncmp file-2-expect file-2 &&
test_i18ngrep "^Applying: 6$" output &&
test_cmp file-2-expect file-2 &&
test ! -f .git/MERGE_RR
'

Expand Down
22 changes: 4 additions & 18 deletions t/t5536-fetch-conflicts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ setup_repository () {
)
}

verify_stderr () {
cat >expected &&
# We're not interested in the error
# "fatal: The remote end hung up unexpectedly":
test_i18ngrep -E '^(fatal|warning):' error | grep -v 'hung up' >actual | sort &&
test_i18ncmp expected actual
}

test_expect_success 'setup' '
git commit --allow-empty -m "Initial" &&
git branch branch1 &&
Expand All @@ -48,9 +40,7 @@ test_expect_success 'fetch conflict: config vs. config' '
"+refs/heads/branch2:refs/remotes/origin/branch1" && (
cd ccc &&
test_must_fail git fetch origin 2>error &&
verify_stderr <<-\EOF
fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1
EOF
test_i18ngrep "fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1" error
)
'

Expand All @@ -77,9 +67,7 @@ test_expect_success 'fetch conflict: arg vs. arg' '
test_must_fail git fetch origin \
refs/heads/*:refs/remotes/origin/* \
refs/heads/branch2:refs/remotes/origin/branch1 2>error &&
verify_stderr <<-\EOF
fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1
EOF
test_i18ngrep "fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1" error
)
'

Expand All @@ -90,10 +78,8 @@ test_expect_success 'fetch conflict: criss-cross args' '
git fetch origin \
refs/heads/branch1:refs/remotes/origin/branch2 \
refs/heads/branch2:refs/remotes/origin/branch1 2>error &&
verify_stderr <<-\EOF
warning: refs/remotes/origin/branch1 usually tracks refs/heads/branch1, not refs/heads/branch2
warning: refs/remotes/origin/branch2 usually tracks refs/heads/branch2, not refs/heads/branch1
EOF
test_i18ngrep "warning: refs/remotes/origin/branch1 usually tracks refs/heads/branch1, not refs/heads/branch2" error &&
test_i18ngrep "warning: refs/remotes/origin/branch2 usually tracks refs/heads/branch2, not refs/heads/branch1" error
)
'

Expand Down

0 comments on commit d92a015

Please sign in to comment.