From e1b24b557d00407fb96755c34a8956afff56a51a Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 26 Sep 2026 08:38:40 -1000 Subject: Add stable markup hooks for site themes --- tests/t0005-markup.sh | 99 ++++++++++++++++++++++++++++++++++++++++++++ tests/t0113-tag.sh | 16 +++---- tests/t0201-filters.sh | 4 +- tests/t0206-trailers.sh | 8 ++-- tests/t0208-mailmap.sh | 2 +- tests/t0506-link-trailers.sh | 2 +- 6 files changed, 115 insertions(+), 16 deletions(-) create mode 100755 tests/t0005-markup.sh (limited to 'tests') diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh new file mode 100755 index 0000000..2a8d572 --- /dev/null +++ b/tests/t0005-markup.sh @@ -0,0 +1,99 @@ +#!/bin/sh + +# Guards the hooks the README promises a site stylesheet or script, so a +# rename in the markup fails here instead of in someone's theme. Each check +# names the page it renders and the attribute or element it expects. + +test_description='Check the markup hooks a theme relies on' +. ./setup.sh + +test_expect_success 'set up a repository with a file that has an extension' ' + mkrepo repos/hooks 2 && + ( + cd repos/hooks && + mkdir dir && + echo "int x;" >dir/hello.c && + git add dir && + git commit -m sources + ) && + { + echo "virtual-root=/" && + echo "cache-size=0" && + echo "enable-blame=1" && + echo "max-stats=year" && + echo "readme=:file-1" && + echo "repo.url=hooks" && + echo "repo.path=$PWD/repos/hooks/.git" + } >hooksrc +' + +hooks() { CGIT_CONFIG="$PWD/hooksrc" QUERY_STRING="url=$1" cgit; } + +test_expect_success 'the root names the page and the repository' ' + hooks "" >tmp && + grep "
" tmp && + hooks "hooks/log/" >tmp && + grep "
" tmp +' + +test_expect_success 'the landmarks and the search form are in place' ' + grep "
" tmp && + grep "