From a7d13649eeea06b70d8f709e6a7dbf99aabb6748 Mon Sep 17 00:00:00 2001 From: Djordje Ungar Date: Tue, 24 Apr 2018 13:13:06 +0200 Subject: [PATCH] Use the tput values instead of raw ansi control sequences for tests, in case the travis terminal does not support some features --- tests/test_tint_functions | 52 ++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/tests/test_tint_functions b/tests/test_tint_functions index 7fb578c..55e766d 100644 --- a/tests/test_tint_functions +++ b/tests/test_tint_functions @@ -6,34 +6,30 @@ source $SCRIPT_DIR/../src/tint ESC='' RESET="${ESC}(B${ESC}[m" -BOLD="1" -DIM="2" -UNDERLINE="4" -BLINK="5" -INVERT="7" -HIDDEN="8" - -BLACK="30" -RED="31" -GREEN="32" -YELLOW="33" -BLUE="34" -MAGENTA="35" -CYAN="36" -LIGHT_GRAY="37" -WHITE="97" - -BLACK_BG="40" -RED_BG="41" -GREEN_BG="42" -YELLOW_BG="43" -BLUE_BG="44" -MAGENTA_BG="45" -CYAN_BG="46" -LIGHT_GRAY_BG="47" -RESET_BG="49" -GRAY_BG="100" -WHITE_BG="107" +BOLD="$(tput bold)" +DIM="$(tput dim)" +UNDERLINE="$(tput smul)" +BLINK="$(tput blink)" +INVERT="$(tput rev)" +HIDDEN="$(tput invis)" + +BLACK="$(tput setaf 0)" +RED="$(tput setaf 1)" +GREEN="$(tput setaf 2)" +YELLOW="$(tput setaf 3)" +BLUE="$(tput setaf 4)" +MAGENTA="$(tput setaf 5)" +CYAN="$(tput setaf 6)" +WHITE="$(tput setaf 7)" + +BLACK_BG="$(tput setab 0)" +RED_BG="$(tput setab 1)" +GREEN_BG="$(tput setab 2)" +YELLOW_BG="$(tput setab 3)" +BLUE_BG="$(tput setab 4)" +MAGENTA_BG="$(tput setab 5)" +CYAN_BG="$(tput setab 6)" +WHITE_BG="$(tput setab 7)" control_sequence() { while test $# -gt 0