Skip to content

Commit 9da8108

Browse files
author
Michael Vasseur
committed
Add function to partial refute in bats
1 parent 609fb0f commit 9da8108

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

submit/assert.bash

+11
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ assert_partial() {
5454
fail "$expected"
5555
}
5656

57+
refute_partial() {
58+
local -r unexpected="$1"
59+
for (( idx = 0; idx < ${#lines[@]}; ++idx )); do
60+
if [[ ${lines[$idx]} == *"$unexpected"* ]]; then
61+
echo "Unexpected string '$unexpected' found."
62+
return 1
63+
fi
64+
done
65+
return 0
66+
}
67+
5768
assert_success() {
5869
if (( status != 0 )); then
5970
echo "Expected success, status=$status."

0 commit comments

Comments
 (0)