From ce898765d270774d5d497674058e4b1390a78245 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 18:26:24 -1000 Subject: Check every selector of the monospace rule The test found the rule by its first selector and knew pre only by the comma after it, so reordering the list failed it while losing kbd or samp did not. --- tests/t0005-markup.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index d5b1610..c9acc27 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -252,11 +252,15 @@ test_expect_success 'root-desc, favicon, head-include and header reach the index ' # A browser gives these elements a monospace font of its own, which would -# otherwise win over the one a theme sets through --font-mono. +# otherwise win over the one a theme sets through --font-mono. Each rule is +# joined onto a line of its own, so a selector is found wherever it stands in +# the list. test_expect_success 'every monospace element takes the theme font' ' - sed -n "/^div#cgit code,$/,/^}/p" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.css" >rule && - grep "^div#cgit pre,$" rule && - grep "^ font-family: var(--font-mono);$" rule + tr "\n}" " \n" <"$TEST_OUTPUT_DIRECTORY/../assets/cgit.css" >rules && + for element in code kbd pre samp + do + grep -E "(^|,) *div#cgit $element *(,[^{]*)?[{].*font-family: var[(]--font-mono[)];" rules || return 1 + done ' test_expect_success 'the stylesheet and the script name only the current hooks' ' -- cgit 2.12.1