diff --git a/test/colored-output.sh b/test/colored-output.sh new file mode 100755 index 0000000..349e2cb --- /dev/null +++ b/test/colored-output.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +. $(dirname "${BASH_SOURCE[0]}")/common.sh + +cd ${CURR_DIR}/1-exec-simple + +# Test --colors=off disabling colors correctly +${DUB} build --colors=off --compiler=${DC} 2>&1 | { ! grep -P '\e\[' -c; } + +# Test --colors=auto detecting no TTY +${DUB} build --colors=auto --compiler=${DC} 2>&1 | { ! grep -P '\e\[' -c; } + +# Test no --colors= option defaulting to auto +${DUB} build --compiler=${DC} 2>&1 | { ! grep -P '\e\[' -c; } + +# Test --colors=on enabling colors in any case +${DUB} build --colors=on --compiler=${DC} 2>&1 | grep -P '\e\[' -c