[PATCH 2/3] t/t4026-color: add test coverage for invalid RGB colors
Make sure that the RGB color parser rejects invalid characters.
Signed-off-by: Beat Bolli <dev+git@drbeat.li>
---
t/t4026-color.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/t/t4026-color.sh b/t/t4026-color.sh
index 37622451fc23..0c39bd74a613 100755
--- a/t/t4026-color.sh
+++ b/t/t4026-color.sh
@@ -140,6 +140,15 @@ test_expect_success 'extra character after attribute' '
invalid_color "dimX"
'
+test_expect_success 'non-hex character in RGB color' '
+ invalid_color "#x23456" &&
+ invalid_color "#1x3456" &&
+ invalid_color "#12x456" &&
+ invalid_color "#123x56" &&
+ invalid_color "#1234x6" &&
+ invalid_color "#12345x"
+'
+
test_expect_success 'unknown color slots are ignored (diff)' '
git config color.diff.nosuchslotwilleverbedefined white &&
git diff --color
--
2.44.0