summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2022-12-28 11:29:05 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2022-12-28 20:08:38 +0000
commitea232477b49a8c00ea46d35a959aa735815fdd9e (patch)
treec45e1fd44eef65ef016c5336e5cc624e8573a8be
parentc9619519e1006c208cca5aca25e2a10bea469482 (diff)
tainted-objects tests: Check error messages are in right context
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xtests/tests/debpolicy-taintrm13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/tests/debpolicy-taintrm b/tests/tests/debpolicy-taintrm
index 56d1edf..0cbc249 100755
--- a/tests/tests/debpolicy-taintrm
+++ b/tests/tests/debpolicy-taintrm
@@ -5,9 +5,12 @@ set -e
t-tstunt-parsechangelog
t-expect-push-fail-local-and-remote () {
- local m="$1"; shift
- t-expect-push-fail-retriably "$m" "$@"
- t-expect-push-fail "$m" "$@" --force-push-tainted
+ # t-expect-push-fail-local-and-remote $mlocal $mremote $push_args...
+ # Messages are implicitly prefixed with 'E:^'
+ # to avoid spotting them in protocol debug output etc.
+ local ml="$1"; local mr="$2"; shift; shift
+ t-expect-push-fail-retriably E:"^$ml" "$@"
+ t-expect-push-fail E:"^$mr" "$@" --force-push-tainted
}
t-debpolicy
@@ -27,6 +30,7 @@ t-commit 'edit after first push'
t-expect-push-fail-local-and-remote \
'Package is in NEW and has not been accepted or rejected yet' \
+ 'remote: Package is in NEW and has not been accepted or rejected yet' \
t-dgit push-source --new
: cut
@@ -44,7 +48,8 @@ t-commit 'edit after cut'
: push, needs --deliberately
t-expect-push-fail-local-and-remote \
- 'all previously pushed versions were found to have been removed from NEW' \
+ ' overrideable .* all previously pushed versions were found to have been removed from NEW' \
+ 'remote: .* all previously pushed versions were found to have been removed from NEW' \
t-dgit push-source --new
t-dgit push-source --new --deliberately-include-questionable-history \