aboutsummaryrefslogtreecommitdiff
path: root/t/test-lib-functions.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-07-13 10:58:41 -0400
committerJunio C Hamano <gitster@pobox.com>2017-07-13 12:42:50 -0700
commit097b681baac3a5e9455c74e3072a458249691e40 (patch)
treefc7ea06a96e684f7ce2b1577a374b68cfb5ba889 /t/test-lib-functions.sh
parent5d3d0681abb8f2bc2383ee7660cf2b02e89cdd07 (diff)
downloadgit-097b681baac3a5e9455c74e3072a458249691e40.tar.gz
git-097b681baac3a5e9455c74e3072a458249691e40.tar.xz
t: use test_decode_color rather than literal ANSI codes
When we put literal ANSI terminal codes into our test scripts, it makes diffs on those scripts hard to read (the colors may be indistinguishable from diff coloring, or in the case of a reset, may not be visible at all). Some scripts get around this by including human-readable names and converting to literal codes with a git-config hack. This makes the actual code diffs look OK, but test_cmp output suffers from the same problem. Let's use test_decode_color instead, which turns the codes into obvious text tags. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib-functions.sh')
-rw-r--r--t/test-lib-functions.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index db622c355..e09e93b38 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -42,6 +42,7 @@ test_decode_color () {
function name(n) {
if (n == 0) return "RESET";
if (n == 1) return "BOLD";
+ if (n == 7) return "REVERSE";
if (n == 30) return "BLACK";
if (n == 31) return "RED";
if (n == 32) return "GREEN";