From b6db34f28f56945a87664aa0e99fef7510757ce0 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 28 Jul 2020 22:45:52 -0700 Subject: [PATCH] option to always show body of response added --- server/tests/main.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) 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