diff options
author | Jeff King <peff@peff.net> | 2017-10-03 15:39:34 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-04 04:25:12 +0200 |
commit | e433749d86c55af27f762c862dbb06d1e108da13 (patch) | |
tree | 293e6ee97e225822ceb00646e646d56823b1f087 /t/t6006-rev-list-format.sh | |
parent | ref-filter: consult want_color() before emitting colors (diff) | |
download | git-e433749d86c55af27f762c862dbb06d1e108da13.tar.xz git-e433749d86c55af27f762c862dbb06d1e108da13.zip |
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/t6006-rev-list-format.sh')
-rwxr-xr-x | t/t6006-rev-list-format.sh | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index b326d550f3..98be78b4a2 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -229,8 +229,7 @@ do ' test_expect_success TTY "$desc respects --color=auto (stdout is tty)" ' - test_terminal env TERM=vt100 \ - git log --format=$color -1 --color=auto >actual && + test_terminal git log --format=$color -1 --color=auto >actual && has_color actual ' |