Diff options
| -rwxr-xr-x | tests/t0005-markup.sh | 12 |
1 file changed, 8 insertions, 4 deletions
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' ' |
