Browse Source

quick fix

main
pvincent 2 days ago
parent
commit
c04c1d6fe4
  1. 8
      test/miaou-bash.test.bash

8
test/miaou-bash.test.bash

@ -9,8 +9,8 @@ readonly TMP_DIRECTORY="/tmp/$(basename "$0")-$UID"
function assert { function assert {
((test_count++)) ((test_count++))
cmd="./test/stub/scenario.bash $1" cmd="./test/stub/scenario.bash $1"
if $cmd >/dev/null 2>/dev/null 3>_miaou; then
if [[ -s _miaou ]]; then
if $cmd >/dev/null 2>/dev/null 3>"$TMP_DIRECTORY"/_miaou; then
if [[ -s "$TMP_DIRECTORY"/_miaou ]]; then
echo -n . echo -n .
return return
fi fi
@ -52,7 +52,7 @@ function fail_type {
cmd="./test/stub/scenario.bash $1" cmd="./test/stub/scenario.bash $1"
# mapfile -t stderr <<<"$(miaou-bash ./test/stub/scenario.bash "$1" 2>&1 >/dev/null 3>/dev/null)" # mapfile -t stderr <<<"$(miaou-bash ./test/stub/scenario.bash "$1" 2>&1 >/dev/null 3>/dev/null)"
$cmd >/dev/null 2>"$TMP_DIRECTORY"/_stderr 3>_miaou
$cmd >/dev/null 2>"$TMP_DIRECTORY"/_stderr 3>"$TMP_DIRECTORY"/_miaou
mapfile -t stderr <"$TMP_DIRECTORY"/_stderr mapfile -t stderr <"$TMP_DIRECTORY"/_stderr
last_error="${stderr[-1]}" last_error="${stderr[-1]}"
@ -60,7 +60,7 @@ function fail_type {
[[ "${last_error}" =~ $regex ]] && success=true [[ "${last_error}" =~ $regex ]] && success=true
if [[ $success == true && -n "${hint_message}" ]]; then if [[ $success == true && -n "${hint_message}" ]]; then
grep -q "${hint_message}" _miaou || success=false
grep -q "${hint_message}" "$TMP_DIRECTORY"/_miaou || success=false
fi fi
if [[ $success == true ]]; then if [[ $success == true ]]; then

Loading…
Cancel
Save