From: Beat Bolli Date: Mon, 29 Apr 2024 16:48:48 GMT Subject: [PATCH 2/3] t/t4026-color: add test coverage for invalid RGB colors Message-ID: <20240429164849.78509-3-dev+git@drbeat.li> In-Reply-To: <20240429164849.78509-1-dev+git@drbeat.li> Make sure that the RGB color parser rejects invalid characters. Signed-off-by: Beat Bolli --- 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