From e805d147b0be970f6698a921634bb0c40ef94d2f Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 6 Sep 2026 19:02:05 -1000 Subject: Extend the html validity checks --- tests/t0002-html-validity.sh | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/tests/t0002-html-validity.sh b/tests/t0002-html-validity.sh index d5103d2..f22b2b6 100755 --- a/tests/t0002-html-validity.sh +++ b/tests/t0002-html-validity.sh @@ -15,7 +15,14 @@ test_url() tidy_options="-eq" test -z "$NO_TIDY_WARNINGS" || tidy_options="$tidy_options --show-warnings no" - cgit_url "$1" >tidy-$test_count.tmp || return + # A second argument names a config of its own, for pages the shared + # config keeps turned off. + if test -n "$2" + then + CGIT_CONFIG="$PWD/$2" QUERY_STRING="url=$1" cgit >tidy-$test_count.tmp || return + else + cgit_url "$1" >tidy-$test_count.tmp || return + fi # Tidy reads what it is given as a whole document, so the response # headers are dropped before it sees the page. strip_headers tidy-$test_count || return @@ -56,5 +63,23 @@ test_expect_success 'foo/tree' 'test_url "foo/tree"' test_expect_success 'foo/tree/file-1' 'test_url "foo/tree/file-1"' test_expect_success 'foo/commit' 'test_url "foo/commit"' test_expect_success 'foo/diff' 'test_url "foo/diff"' +test_expect_success 'foo/refs' 'test_url "foo/refs"' +test_expect_success 'error page' 'test_url "no-such-repo"' + +# Stats and blame stay off in the shared config, so their pages validate +# through a config of their own. +test_expect_success 'set up a features config' ' + { + echo "virtual-root=/" && + echo "cache-size=0" && + echo "max-stats=year" && + echo "enable-blame=1" && + echo "repo.url=feat" && + echo "repo.path=$PWD/repos/foo/.git" + } >featrc +' + +test_expect_success 'stats page' 'test_url "feat/stats/" featrc' +test_expect_success 'blame page' 'test_url "feat/blame/file-1" featrc' test_done -- cgit v2.8.0