From c1f46ada4248bc7f6850bcc309d49359ba51cb48 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 09:32:51 -1000 Subject: Make the stylesheet and script checks able to fail The negated greps passed on a missing or renamed file, and the old hooks were matched with an alternation POSIX leaves undefined in a basic expression, so a grep that read the bars literally never matched anything. --- tests/t0005-markup.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index 064e74d..073fbc1 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -160,9 +160,9 @@ test_expect_success 'every monospace element takes the theme font' ' ' test_expect_success 'the stylesheet and the script name only the current hooks' ' - ! grep "_dark\|#summary\|ul.pager\|td:empty" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.css" && - grep "window.cgit.updateAges" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.js" && - grep "window.cgit.highlightLines" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.js" + test_grep ! -E "_dark|#summary|ul\.pager|td:empty" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.css" && + test_grep "window.cgit.updateAges" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.js" && + test_grep "window.cgit.highlightLines" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.js" ' # The background is set as --bg, again on html.cgit-standalone for the canvas @@ -189,7 +189,8 @@ test_expect_success 'the script waits for the page instead of holding it up' ' # A collection from getElementsByClassName is live, so an age the loop moves to # another unit drops out of it at once and the age after it is skipped. test_expect_success 'the script walks the ages from a list that holds still' ' - ! grep "getElementsByClassName" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.js" + test_grep "window.cgit.updateAges" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.js" && + test_grep ! "getElementsByClassName" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.js" ' # The line anchors carry a scroll margin of half the window, which centres a -- cgit 2.12.1