From 7cd3e80f268be44b66690af40b064f742c8dd40f Mon Sep 17 00:00:00 2001 From: Mitchell Krog Date: Sun, 23 Jun 2019 12:46:17 +0200 Subject: [PATCH] Improve Test Commenting and Coloring --- .dev-tools/test-blocker.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.dev-tools/test-blocker.sh b/.dev-tools/test-blocker.sh index e3e93daef..c6acee5e6 100755 --- a/.dev-tools/test-blocker.sh +++ b/.dev-tools/test-blocker.sh @@ -294,9 +294,9 @@ lines=$(cat ${file}) for line in ${lines}; do if curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then - echo "${bold}$(tput setaf 2)${line} $(tput setaf 2)was ALLOWED - ${bold}$(tput setaf 2)TEST PASSED" + echo "${bold}${green}PASSED - ${green}${line}was ALLOWED" else - echo "${bold}$(tput setaf 1)${line} $(tput setaf 1)was NOT ALLOWED - ${bold}$(tput setaf 1)TEST FAILED" + echo "${bold}${red}FAILED - ${red}${line} was BLOCKED" fi done IFS="" @@ -314,9 +314,9 @@ lines=$(cat ${file}) for line in ${lines}; do if curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then - echo "${bold}$(tput setaf 2)${line} $(tput setaf 2)was ALLOWED - ${bold}$(tput setaf 2)TEST PASSED" + echo "${bold}${green}PASSED - ${green}${line} was ALLOWED" else - echo "${bold}$(tput setaf 1)${line} $(tput setaf 1)was NOT ALLOWED - ${bold}$(tput setaf 1)TEST FAILED" + echo "${bold}${red}FAILED - ${red}${line} was BLOCKED" fi done IFS="" @@ -333,9 +333,9 @@ lines=$(cat ${file}) for line in ${lines}; do if curl -v -A "${line}" http://localhost:9000 2>&1 | grep -i 'Welcome'; then - echo "${bold}$(tput setaf 2)${line} $(tput setaf 2)was ALLOWED - ${bold}$(tput setaf 2)TEST PASSED" + echo "${bold}${green}PASSED - ${green}${line} was ALLOWED" else - echo "${bold}$(tput setaf 1)${line} $(tput setaf 1)was NOT ALLOWED - ${bold}$(tput setaf 1)TEST FAILED" + echo "${bold}${green}FAILED - ${red}${line} was BLOCKED" fi done IFS="" @@ -353,9 +353,9 @@ lines=$(cat ${file}) for line in ${lines}; do if curl -I http://localhost:9000 -e "http://${line}" 2>&1 | grep -i '(52)'; then - echo "${bold}$(tput setaf 1)${line} $(tput setaf 1)was BLOCKED - ${bold}$(tput setaf 2)TEST PASSED" + echo "${bold}${green}PASSED - ${red}${line} was BLOCKED" else - echo "${bold}$(tput setaf 1)${line} $(tput setaf 1)was NOT BLOCKED - ${bold}$(tput setaf 1)TEST FAILED" + echo "${bold}${red}FAILED - ${red}${line} was NOT BLOCKED" fi done IFS=""