X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4026-color.sh;h=3726a0e2012e534623ddbdd71da04f177c32d4d0;hb=75b182aee702aa82bec81c542788eb9149a68fa0;hp=5ade44c043ca6577b2e331b152515359128dbd32;hpb=c444c16589f95ac22d8e3ffe603cd7f0613512ce;p=git.git diff --git a/t/t4026-color.sh b/t/t4026-color.sh index 5ade44c04..3726a0e20 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" ' @@ -67,7 +74,6 @@ test_expect_success 'extra character after attribute' ' ' test_expect_success 'unknown color slots are ignored (diff)' ' - git config --unset diff.color.new git config color.diff.nosuchslotwilleverbedefined white && git diff --color '