Skip to content

Commit

Permalink
Use the tput values instead of raw ansi control sequences for tests, …
Browse files Browse the repository at this point in the history
…in case the travis terminal does not support some features
  • Loading branch information
ArtBIT committed Apr 24, 2018
1 parent e748ec2 commit a7d1364
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions tests/test_tint_functions
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a7d1364

Please sign in to comment.