From 113eec9f1a210f2b4a3b7c41bc6da54ee9590be2 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 18:18:24 -1000 Subject: Set the site title once in the markup tests --- tests/t0005-markup.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index 8251393..c05f404 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -8,6 +8,10 @@ test_description='Check the markup hooks a theme relies on' CGIT_TEST_NO_CREATE_REPOS=YesPlease . ./setup.sh +# The site gets a title of its own, as a page that wrote the default out as +# a fixed string would otherwise pass for one that read root-title. +site=Example + test_expect_success 'set up a repository with a file that has an extension' ' mkrepo repos/hooks 2 && ( @@ -17,7 +21,8 @@ test_expect_success 'set up a repository with a file that has an extension' ' git add dir && git commit -m sources ) && - cgitrc_repo hooksrc hooks enable-blame=1 max-stats=year readme=:file-1 + cgitrc_repo hooksrc hooks enable-blame=1 max-stats=year readme=:file-1 \ + "root-title=$site" ' test_expect_success 'the root names the page and the repository' ' @@ -106,7 +111,6 @@ test_expect_success 'the blob, blame and about pages open with their own contain ' test_expect_success 'each page names itself, then the repository and the site' ' - site="Git repository browser" && cgit_rc hooksrc "url=hooks/" >tmp && grep "hooks - $site" tmp && for page in about log refs tree stats @@ -123,7 +127,6 @@ test_expect_success 'each page names itself, then the repository and the site' ' # A commit the page is pinned to belongs with the page's own name, or with the # repository's on the summary, which has no name of its own. test_expect_success 'a pinned page names its commit before the repository' ' - site="Git repository browser" && old=$(git -C repos/hooks rev-parse HEAD~1 | cut -c1-10) && cgit_rc hooksrc "url=hooks/tree/&id=$old" >tmp && grep "tree @ $old - hooks - $site" tmp && @@ -137,17 +140,16 @@ test_expect_success 'a pinned page names its commit before the repository' ' # which by default is the site's index. test_expect_success 'the logo is named after the site' ' cgit_rc hooksrc "url=hooks/" >tmp && - grep ".Git" tmp + grep ".$site." tmp ' test_expect_success 'an error page names the error where a page names itself' ' - site="Git repository browser" && cgit_rc hooksrc "url=hooks/tree/missing" >tmp && grep "^Status: 404" tmp && grep "Not Found - hooks - $site" tmp && cgit_rc hooksrc "url=hooks/nonsense/" >tmp && grep "Not Found - hooks - $site" tmp && - cgitrc_repo brokenrc broken "repo.path=$PWD/nowhere" && + cgitrc_repo brokenrc broken "root-title=$site" "repo.path=$PWD/nowhere" && cgit_rc brokenrc "url=broken/" >tmp && grep "Failed to open broken" tmp && grep "Not Found - $site" tmp -- cgit 2.12.1