safe extra_args
This commit is contained in:
@@ -28,7 +28,6 @@ function assert_grep {
|
||||
((test_count++))
|
||||
local script="$1" content="$2" extra_args=()
|
||||
[[ $# -gt 3 ]] && shift 3 && extra_args=("$@")
|
||||
#TODO: quote extra_args
|
||||
cmd="./test/stub/scenario.bash $script"
|
||||
if $cmd "${extra_args[@]}" >_stdout 2>/dev/null 3>/dev/null; then
|
||||
if grep -q "$content" _stdout; then
|
||||
@@ -37,7 +36,9 @@ function assert_grep {
|
||||
fi
|
||||
fi
|
||||
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
|
||||
}
|
||||
function fail_type {
|
||||
|
||||
Reference in New Issue
Block a user