summaryrefslogtreecommitdiff
path: root/t/t7006-pager.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-10-03 13:39:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-10-04 02:25:12 (GMT)
commite433749d86c55af27f762c862dbb06d1e108da13 (patch)
tree293e6ee97e225822ceb00646e646d56823b1f087 /t/t7006-pager.sh
parent11b087adfd469ca597f1d269314f8cad32d0d72f (diff)
downloadgit-e433749d86c55af27f762c862dbb06d1e108da13.zip
git-e433749d86c55af27f762c862dbb06d1e108da13.tar.gz
git-e433749d86c55af27f762c862dbb06d1e108da13.tar.bz2
test-terminal: set TERM=vt100
The point of the test-terminal script is to simulate in the test scripts an environment where output is going to a real terminal. But since test-lib.sh also sets TERM=dumb, the simulation isn't very realistic. The color code will skip auto-coloring for TERM=dumb, leading to us liberally sprinkling test_terminal env TERM=vt100 git ... through the test suite to convince the tests to actually generate colors. Let's set TERM for programs run under test_terminal, which is one less thing for test-writers to remember. In most cases the callers can be simplified, but note there is one interesting case in t4202. It uses test_terminal to check the auto-enabling of --decorate, but the expected output _doesn't_ contain colors (because TERM=dumb suppresses them). Using TERM=vt100 is closer to what the real world looks like; adjust the expected output to match. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7006-pager.sh')
-rwxr-xr-xt/t7006-pager.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 20b4d83..20caa3f 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -159,7 +159,7 @@ test_expect_success 'no color when stdout is a regular file' '
test_expect_success TTY 'color when writing to a pager' '
rm -f paginated.out &&
test_config color.ui auto &&
- test_terminal env TERM=vt100 git log &&
+ test_terminal git log &&
colorful paginated.out
'
@@ -167,7 +167,7 @@ test_expect_success TTY 'colors are suppressed by color.pager' '
rm -f paginated.out &&
test_config color.ui auto &&
test_config color.pager false &&
- test_terminal env TERM=vt100 git log &&
+ test_terminal git log &&
! colorful paginated.out
'
@@ -186,7 +186,7 @@ test_expect_success 'color when writing to a file intended for a pager' '
test_expect_success TTY 'colors are sent to pager for external commands' '
test_config alias.externallog "!git log" &&
test_config color.ui auto &&
- test_terminal env TERM=vt100 git -p externallog &&
+ test_terminal git -p externallog &&
colorful paginated.out
'