chiark / gitweb /
Test suite: Move most of mustfail into t-expect-fail
[dgit.git] / tests / tests / drs-push-rejects
index 640aeae6914cbe8630488b21d3e4be68ad7b3de0..13567c3f3a7b771ca235af9589fdb5f8524310aa 100755 (executable)
@@ -11,20 +11,12 @@ t-worktree drs
 cd $p
 
 mustfail () {
-       local wantmsg="$1"; shift
+       local mpat="$1"; shift
        t-reporefs pre-push
-       set +o pipefail
+
+       t-expect-fail "$mpat" \
        git push origin "$@" 2>&1 |tee $tmp/mustfail.txt
-       ps="${PIPESTATUS[*]}"
-       set -o pipefail
-       case $ps in
-       "0 0")  fail "push unexpectedly succeeded (instead of: $wantmsg)" ;;
-       *" 0")  ;;
-       *)      fail "tee failed"  ;;
-       esac
-       if ! fgrep "$wantmsg" $tmp/mustfail.txt >/dev/null; then
-               fail "error message not found"
-       fi
+
        t-reporefs post-push
        diff $tmp/show-refs.{pre,post}-push
 }