From 754cba2ebe4ccb3111990f1bc6aac1a1b8bca7a8 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 11:26:34 -1000 Subject: Test an empty search under a url prefix Only a prefix holding no repository and a search of the whole index were tested, so the check that tells the two messages apart could go unnoticed. --- tests/t0101-index.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index ca0c88d..f8118b3 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh @@ -69,6 +69,23 @@ test_expect_success 'a url matching no repository says so' ' grep "
No repositories found
" tmp ' +test_expect_success 'a search finding nothing under a url prefix says so' ' + { + echo "virtual-root=/" && + echo "cache-size=0" && + echo "repo.url=a/x" && + echo "repo.path=$PWD/repos/foo/.git" && + echo "repo.url=a/y" && + echo "repo.path=$PWD/repos/foo/.git" + } >prefixrc && + cgit_ok prefixrc "url=a/" >tmp && + test_grep ">a/x" tmp && + test_grep ">a/y" tmp && + cgit_rc prefixrc "url=a/&q=zzz" >tmp && + test_grep "^Status: 404" tmp && + test_grep "
No repositories found
" tmp +' + # Fails unless the index of orderrc, asked for with the query given first, # lists the repositories in the order the rest name. test_index_order() { -- cgit 2.12.1