From 978faace53a89fbd40daf97be4c0a8d30d097f02 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 11:19:29 -1000 Subject: Hold the index tests to a working page The index requests passed on any answer short of a crash. The checks for the missing tree and log links read a page an earlier test wrote, so run alone they passed with no page at all. The description and summary link checks matched their text anywhere on the page rather than in foo's row. --- tests/t0101-index.sh | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'tests/t0101-index.sh') diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index be947af..d269bdc 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh @@ -10,27 +10,32 @@ test_description='Check content on index page' . ./setup.sh -test_expect_success 'generate index page' 'cgit_url "" >tmp' +test_expect_success 'generate index page' 'cgit_ok_url "" >tmp' test_expect_success 'find foo repo' 'grep ">foo" tmp' -test_expect_success 'find foo description' 'grep "\[no description\]" tmp' +test_expect_success 'find foo description' 'grep "href=./foo/.>\[no description\]" tmp' test_expect_success 'find bar repo' 'grep ">bar" tmp' test_expect_success 'find bar description' 'grep "the bar repo" tmp' test_expect_success 'find foo+bar repo' 'grep ">foo+bar<" tmp' test_expect_success 'verify foo+bar links' 'test $(grep -o "href=./foo%2Bbar/." tmp | wc -l) = 2' test_expect_success 'verify "with%20space" links' 'test $(grep -o "href=./with%20space/." tmp | wc -l) = 2' -test_expect_success 'no tree-link' '! grep "foo/tree" tmp' -test_expect_success 'no log-link' '! grep "foo/log" tmp' + +test_expect_success 'the index links no tree or log by default' ' + cgit_ok_url "" >tmp && + test_grep ">foo" tmp && + test_grep ! "foo/tree" tmp && + test_grep ! "foo/log" tmp +' test_expect_success 'index links lead to the summary, log and tree' ' - cgitrc_copy links-cgitrc enable-index-links=1 && - cgit_rc links-cgitrc "url=" >tmp && - grep ">summarylog" tmp && + cgitrc_copy linksrc enable-index-links=1 && + cgit_ok linksrc "url=" >tmp && + grep "summarylog" tmp && grep "href=./foo/log/.>logtree<" tmp ' test_expect_success 'each css and js entry gets a link of its own' ' cgitrc_copy headrc css=/a.css css=/b.css js=/a.js js= js=/b.js && - cgit_rc headrc "url=" >tmp && + cgit_ok headrc "url=" >tmp && grep "" tmp && grep "" tmp && grep "