Commit ff2b5dc9 by Mislav Marohnić

Ensure that `assert_output_contains` receives an argument

parent 7f1869cb
...@@ -115,6 +115,10 @@ assert_output() { ...@@ -115,6 +115,10 @@ assert_output() {
assert_output_contains() { assert_output_contains() {
local expected="$1" local expected="$1"
if [ -z "$expected" ]; then
echo "assert_output_contains needs an argument" >&2
return 1
fi
echo "$output" | $(type -p ggrep grep | head -1) -F "$expected" >/dev/null || { echo "$output" | $(type -p ggrep grep | head -1) -F "$expected" >/dev/null || {
{ echo "expected output to contain $expected" { echo "expected output to contain $expected"
echo "actual: $output" echo "actual: $output"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment