]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t4026-color.sh
Merge branch 'vn/xmmap-gently' into maint
[thirdparty/git.git] / t / t4026-color.sh
index ec78c5e3ac5661977b30582df9bec95265e1c613..671e951ee5498c7691c5e996c9dfd75dac3e8861 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,6 +22,10 @@ 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"
 '