|
|
@ -28,7 +28,6 @@ function assert_grep { |
|
|
((test_count++)) |
|
|
((test_count++)) |
|
|
local script="$1" content="$2" extra_args=() |
|
|
local script="$1" content="$2" extra_args=() |
|
|
[[ $# -gt 3 ]] && shift 3 && extra_args=("$@") |
|
|
[[ $# -gt 3 ]] && shift 3 && extra_args=("$@") |
|
|
#TODO: quote extra_args |
|
|
|
|
|
cmd="./test/stub/scenario.bash $script" |
|
|
cmd="./test/stub/scenario.bash $script" |
|
|
if $cmd "${extra_args[@]}" >_stdout 2>/dev/null 3>/dev/null; then |
|
|
if $cmd "${extra_args[@]}" >_stdout 2>/dev/null 3>/dev/null; then |
|
|
if grep -q "$content" _stdout; then |
|
|
if grep -q "$content" _stdout; then |
|
|
@ -37,7 +36,9 @@ function assert_grep { |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
echo -n F |
|
|
echo -n F |
|
|
failures+=("$cmd") |
|
|
|
|
|
|
|
|
#TODO: quote extra_args |
|
|
|
|
|
for i in "${extra_args[@]}"; do safe_args+=$(printf '%q ' "$i"); done |
|
|
|
|
|
failures+=("$cmd $safe_args") |
|
|
return 1 |
|
|
return 1 |
|
|
} |
|
|
} |
|
|
function fail_type { |
|
|
function fail_type { |
|
|
|