]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t: add matching negative attributes to test_decode_color
authorJeff King <peff@peff.net>
Mon, 23 Mar 2026 06:02:07 +0000 (02:02 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 Mar 2026 14:42:27 +0000 (07:42 -0700)
Most of the ANSI color attributes have an "off" variant. We don't use
these yet in our test suite, so we never bothered to decode them. Add
the ones that match the attributes we encode so we can make use of them.

There are even more attributes not covered on the positive side, so this
is meant to be useful but not all-inclusive.

Note that "nobold" and "nodim" are the same code, so I've decoded this
as "normal intensity".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib-functions.sh

index 14e238d24da9addef7a0eeb43c32748b14c8e2e0..f3af10fb7e020500f10336c4a7b7e698b9d135e4 100644 (file)
@@ -48,6 +48,9 @@ test_decode_color () {
                        if (n == 2) return "FAINT";
                        if (n == 3) return "ITALIC";
                        if (n == 7) return "REVERSE";
+                       if (n == 22) return "NORMAL_INTENSITY";
+                       if (n == 23) return "NOITALIC";
+                       if (n == 27) return "NOREVERSE";
                        if (n == 30) return "BLACK";
                        if (n == 31) return "RED";
                        if (n == 32) return "GREEN";