]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t4026-color.sh
color.c: alias RGB colors 8-15 to aixterm colors
[thirdparty/git.git] / t / t4026-color.sh
index ec78c5e3ac5661977b30582df9bec95265e1c613..c0b642c1ab03f27dabc58e3b99ba9f8f48bf35d8 100755 (executable)
@@ -6,10 +6,11 @@
 test_description='Test diff/status color escape codes'
 . ./test-lib.sh
 
+ESC=$(printf '\033')
 color()
 {
        actual=$(git config --get-color no.such.slot "$1") &&
-       test "$actual" = "\e$2"
+       test "$actual" = "${2:+$ESC}$2"
 }
 
 invalid_color()
@@ -21,10 +22,22 @@ test_expect_success 'reset' '
        color "reset" "[m"
 '
 
+test_expect_success 'empty color is empty' '
+       color "" ""
+'
+
 test_expect_success 'attribute before color name' '
        color "bold red" "[1;31m"
 '
 
+test_expect_success 'aixterm bright fg color' '
+       color "brightred" "[91m"
+'
+
+test_expect_success 'aixterm bright bg color' '
+       color "green brightblue" "[32;104m"
+'
+
 test_expect_success 'color name before attribute' '
        color "red bold" "[1;31m"
 '
@@ -69,6 +82,10 @@ test_expect_success '0-7 are aliases for basic ANSI color names' '
        color "0 7" "[30;47m"
 '
 
+test_expect_success '8-15 are aliases for aixterm color names' '
+       color "12 13" "[94;105m"
+'
+
 test_expect_success '256 colors' '
        color "254 bold 255" "[1;38;5;254;48;5;255m"
 '