From: Jeff King Date: Fri, 20 Mar 2026 00:43:36 GMT Subject: [PATCH 4/8] t: add matching negative attributes to test_decode_color Message-ID: <20260320004336.GD3654226@coredump.intra.peff.net> In-Reply-To: <20260320004138.GA3653623@coredump.intra.peff.net> 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 --- This is the only patch that touches anything outside of contrib/diff-highlight, but hopefully it is uncontroversial. ;) t/test-lib-functions.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 14e238d24d..f3af10fb7e 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -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"; -- 2.53.0.945.ge67b727e8d