Skip to content

Commit cb35722

Browse files
peffgitster
authored andcommitted
t4026: test "normal" color
If the user specifiers "normal" for a foreground color, this should be a noop (while this may sound useless, it is the only way to specify an unchanged foreground color followed by a specific background color). We also check that color "-1" does the same thing. This is not documented, but has worked forever, so let's make sure we keep supporting it. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d0e08d6 commit cb35722

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

t/t4026-color.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ test_expect_success '256 colors' '
5353
color "254 bold 255" "[1;38;5;254;48;5;255m"
5454
'
5555

56+
test_expect_success '"normal" yields no color at all"' '
57+
color "normal black" "[40m"
58+
'
59+
60+
test_expect_success '-1 is a synonym for "normal"' '
61+
color "-1 black" "[40m"
62+
'
63+
5664
test_expect_success 'color too small' '
5765
invalid_color "-2"
5866
'

0 commit comments

Comments
 (0)