t7301: use test_terminal to check color
This test wants to confirm that "clean -i" shows color output. Using test_terminal gives us a more realistic environment than "color.ui=always", and prepares us for the behavior of "always" changing in a future patch. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Oct 3, 2017 at 09:44 UTC
3c788e79b8570c9015f6077591c819862a7e39e8
1 file changed
+3
-2
t/t7301-clean-interactive.sh
+3
-2
@@ -3,6 +3,7 @@
3
test_description='git clean -i basic tests'
4
5
. ./test-lib.sh
6
+. "$TEST_DIRECTORY"/lib-terminal.sh
7
8
test_expect_success 'setup' '
9
@@ -472,10 +473,10 @@ test_expect_success 'git clean -id with prefix and path (ask)' '
473
474
'
475
475
-test_expect_success 'git clean -i paints the header in HEADER color' '
476
+test_expect_success TTY 'git clean -i paints the header in HEADER color' '
477
>a.out &&
478
echo q |
478
- git -c color.ui=always clean -i |
479
+ test_terminal env TERM=vt100 git clean -i |
480
test_decode_color |
481
head -n 1 >header &&
482
# not i18ngrep