summaryrefslogtreecommitdiff
path: root/t/t4026-color.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-02-28 02:56:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-07 20:00:36 (GMT)
commit8b124135a97b593d50a90abcec231552b31c7ade (patch)
tree174c3351039ccb082ef50f95811d0dfa3128fa5c /t/t4026-color.sh
parentc5034673fd92b6278e6c9d55683770ec01fafc89 (diff)
downloadgit-8b124135a97b593d50a90abcec231552b31c7ade.zip
git-8b124135a97b593d50a90abcec231552b31c7ade.tar.gz
git-8b124135a97b593d50a90abcec231552b31c7ade.tar.bz2
color: allow multiple attributes
In configuration files (and "git config --color" command line), we supported one and only one attribute after foreground and background color. Accept combinations of attributes, e.g. [diff.color] old = red reverse bold Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4026-color.sh')
-rwxr-xr-xt/t4026-color.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/t/t4026-color.sh b/t/t4026-color.sh
index b61e516..49eced2 100755
--- a/t/t4026-color.sh
+++ b/t/t4026-color.sh
@@ -8,14 +8,13 @@ test_description='Test diff/status color escape codes'
color()
{
- git config diff.color.new "$1" &&
- test "`git config --get-color diff.color.new`" = "$2"
+ actual=$(git config --get-color no.such.slot "$1") &&
+ test "$actual" = "$2"
}
invalid_color()
{
- git config diff.color.new "$1" &&
- test -z "`git config --get-color diff.color.new 2>/dev/null`"
+ test_must_fail git config --get-color no.such.slot "$1"
}
test_expect_success 'reset' '
@@ -42,6 +41,14 @@ test_expect_success 'fg bg attr' '
color "blue red ul" "[4;34;41m"
'
+test_expect_success 'fg bg attr...' '
+ color "blue bold dim ul blink reverse" "[1;2;4;5;7;34m"
+'
+
+test_expect_success 'long color specification' '
+ color "254 255 bold dim ul blink reverse" "[1;2;4;5;7;38;5;254;48;5;255m"
+'
+
test_expect_success '256 colors' '
color "254 bold 255" "[1;38;5;254;48;5;255m"
'