Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-11-20 18:16:09 +0300
committerJunio C Hamano <gitster@pobox.com>2014-11-20 21:54:10 +0300
commitcb357221a402c55b23bf99ec9f3b361709d45fa7 (patch)
treef646d588cf663c962291914e7061a82f4d23bac0 /t/t4026-color.sh
parentd0e08d62335ce9685ac547287771e589587334b6 (diff)
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4026-color.sh')
-rwxr-xr-xt/t4026-color.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t4026-color.sh b/t/t4026-color.sh
index 3726a0e201..63e423838f 100755
--- a/t/t4026-color.sh
+++ b/t/t4026-color.sh
@@ -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"
'