Code

Merge branch 'jc/color-attrs'
[git.git] / t / t4026-color.sh
index 5ade44c043ca6577b2e331b152515359128dbd32..d5ccdd0cf8061e797e88185bfddb0864f73291dd 100755 (executable)
@@ -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`" = "\e$2"
+       actual=$(git config --get-color no.such.slot "$1") &&
+       test "$actual" = "\e$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"
 '