From 7ce4f8bef216e47a1bd8b9ea422364178f318432 Mon Sep 17 00:00:00 2001 From: Bryan Killian Date: Wed, 25 Mar 2020 16:21:59 -0400 Subject: [PATCH] test(integration): set files var to name of filesvar for nondev nonsimple --- .github/actions/integration/test.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/actions/integration/test.sh b/.github/actions/integration/test.sh index 22be64ac..90adb1d2 100755 --- a/.github/actions/integration/test.sh +++ b/.github/actions/integration/test.sh @@ -59,14 +59,16 @@ prepareTest () { else file=$txt_output fi - elif [ "$dev" == "dev" ] && [ "$1" != "simple_" ]; then + else declare -n file=${2} - if [ "$4" == "json" ]; then - file="$(cat events/${!file}.json)" - elif [ "$4" == "," ]; then - file="$(cat events/${!file}.csv)" - else - file="$(cat events/${!file}.txt)" + if [ "$dev" == "dev" ]; then + if [ "$4" == "json" ]; then + file="$(cat events/${!file}.json)" + elif [ "$4" == "," ]; then + file="$(cat events/${!file}.csv)" + else + file="$(cat events/${!file}.txt)" + fi fi fi echo "${file}" @@ -96,7 +98,7 @@ testResults () { if [ "$2" == 'json' ]; then expected=$(($expected+1)) fi - if [ $3 != $expected ]; then + if [ "$3" != "$expected" ]; then echo -e "\t\033[1;91mTest failure $5/($1)$4:'$2' { EXPECTED:$expected RECEIVED:$3 } \033[0m" exit 1; fi