From aac81630c81f7bef8920ce4681033f481c62a64c Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 10:53:54 -1000 Subject: Cover the rest of syntax-highlight's output No token ever took hl-type or hl-comment, so a typo in either row, or a rule gone from the stylesheet, passed. Nothing fed the filter a NUL byte or a blob of exactly the size cap either. --- tests/t0502-syntax-highlight.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/t0502-syntax-highlight.sh') diff --git a/tests/t0502-syntax-highlight.sh b/tests/t0502-syntax-highlight.sh index c0b4480..cb31bfc 100755 --- a/tests/t0502-syntax-highlight.sh +++ b/tests/t0502-syntax-highlight.sh @@ -32,6 +32,17 @@ do ' done +# A class the filter writes with no rule in the stylesheet colours nothing. +test_expect_success 'every class the filter writes is styled' ' + sed -n "s/^.*= \"\(hl-[a-z]*\)\",$/\1/p" "$EXTENSIONS_DIRECTORY/syntax-highlight.lua" | + sort -u >classes && + test -s classes && + while read class + do + test_grep "^div#cgit \.$class {" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.css" || return 1 + done