Newer
Older
dub_jkp / test / colored-output.sh
@Giacomo De Lazzari Giacomo De Lazzari on 28 Jul 2022 556 bytes Add new test for colored output
#!/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