From 035394e3836fb981c7b0d3e4b72ca745fb56e0ad Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 10:04:02 -1000 Subject: Check the whole page in the extension tests A page that died part way through, or logged an error, passed as long as the text grepped for came before the failure. Four tests also read the page an earlier test had fetched, so none of them could run alone. --- tests/t0502-syntax-highlight.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests/t0502-syntax-highlight.sh') diff --git a/tests/t0502-syntax-highlight.sh b/tests/t0502-syntax-highlight.sh index dbb7bb0..186d0a8 100755 --- a/tests/t0502-syntax-highlight.sh +++ b/tests/t0502-syntax-highlight.sh @@ -54,13 +54,14 @@ test_expect_success 'place the fake lexers beside a config naming the filter' ' ' test_expect_success CGIT_LUA 'the tree view is highlighted' ' - cgit_url "fake/tree/hello.fake" >tmp && - grep "if" tmp && - grep "42" tmp + cgit_ok_url "fake/tree/hello.fake" >tmp && + test_grep "if" tmp && + test_grep "42" tmp ' test_expect_success CGIT_LUA 'bytes between tokens reach the page escaped' ' - grep "42 & " tmp + cgit_ok_url "fake/tree/hello.fake" >tmp && + test_grep "42 & " tmp ' # A missing scintillua leaves the filter with nothing to highlight with, and @@ -81,8 +82,8 @@ test_expect_success CGIT_LUA 'a lone carriage return reaches the page as an esca git add cr.fake && git commit -m "add a lone carriage return" ) && - cgit_url "fake/tree/cr.fake" >tmp && - grep "if\\\\r" tmp + cgit_ok_url "fake/tree/cr.fake" >tmp && + test_grep "if\\\\r" tmp ' test_done -- cgit 2.12.1