From a63115c491416fc1f02c48c6e07f6d1d57c018fc Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 19:21:59 -1000 Subject: Move the root-readme test to the index tests The test reads the index and the site about page, both drawn by ui-repolist.c. Its site had no repositories, so the index it read was the error page, and a readme printed below the list went unseen. The shared repositories give it a real index. --- tests/t0101-index.sh | 12 ++++++++++++ tests/t0301-security.sh | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index e3d2148..d3d4469 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh @@ -44,6 +44,18 @@ test_expect_success 'each css and js entry gets a link of its own' ' grep "/b.js" scripts ' +# root-readme is the site's own file rather than repository content, so it +# goes out as written, on an about page of its own. +test_expect_success 'root-readme without a filter is its own page, as written' ' + echo "site" >root.html && + cgitrc_copy rootrc "root-readme=$PWD/root.html" && + cgit_ok rootrc "url=" >tmp && + test_grep "
  • about" tmp && + test_grep ! "site" tmp && + cgit_ok rootrc "p=about" >tmp && + test_grep "^site$" tmp +' + # The description limit counts bytes, so a cut has to land between # characters rather than leave half of one on the page. test_expect_success 'a cut description keeps whole characters' ' diff --git a/tests/t0301-security.sh b/tests/t0301-security.sh index 870d2c5..6ea8d45 100755 --- a/tests/t0301-security.sh +++ b/tests/t0301-security.sh @@ -104,18 +104,6 @@ test_expect_success 'non-markdown readme without a filter is escaped as plain te test_grep ! "" tmp ' -# root-readme is the site's own file rather than repository content, so it -# goes out as written, on an about page of its own. -test_expect_success 'root-readme without a filter is its own page, as written' ' - echo "site" >root.html && - cgitrc_site secrootrc "root-readme=$PWD/root.html" && - cgit_rc secrootrc "url=" >tmp && - grep "
  • about" tmp && - ! grep "site" tmp && - cgit_rc secrootrc "p=about" >tmp && - grep "^site$" tmp -' - # A Content-Security-Policy without unsafe-inline stops an inline onchange # handler from ever running, so the option form submits through a plain # button and its selects carry no handlers at all, and nor does any other -- cgit 2.12.1