diff --git a/server/tests/main.sh b/server/tests/main.sh index 6ce67f7..c790e9a 100644 --- a/server/tests/main.sh +++ b/server/tests/main.sh @@ -10,6 +10,7 @@ # 1. is properly formatted # 2. has all the info we need & none we don't # 3. has basically nothing malicious about it + log_result() { name=$1 expect=$2 @@ -26,9 +27,18 @@ log_result() { echo -e ${red}==========${nc} else echo -e ${green}${name}${nc} $expect $actual + if [ ! -z "$_show_body" ];then + echo ========== + echo "$result" | sed 's/^/\t/g' + echo ========== + fi fi } +if [ "$1" = "body" ];then + export _show_body=1 +fi + source ./common.sh export -f log_result echo TestName ExpectedCode ActualCode