Skip to content

Commit

Permalink
t4026: test "normal" color
Browse files Browse the repository at this point in the history
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Nov 20, 2014
1 parent d0e08d6 commit cb35722
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions t/t4026-color.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ test_expect_success '256 colors' '
color "254 bold 255" "[1;38;5;254;48;5;255m"
'

test_expect_success '"normal" yields no color at all"' '
color "normal black" "[40m"
'

test_expect_success '-1 is a synonym for "normal"' '
color "-1 black" "[40m"
'

test_expect_success 'color too small' '
invalid_color "-2"
'
Expand Down

0 comments on commit cb35722

Please sign in to comment.