From bdd3af7c6ab23ecb8fc377b3404282793eb9c802 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 1 Nov 2026 16:10:49 -1000 Subject: Say when nothing matches a mistyped url --- tests/t0101-index.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index 0953b8d..fcf873b 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh @@ -53,6 +53,17 @@ test_expect_success 'a cut description keeps whole characters' ' grep ">日本語\.\.\." tmp ' +# A url naming no repository falls through to the index as a prefix that +# matches none, which is not the same as a search finding nothing. +test_expect_success 'a url matching no repository says so' ' + cgit_url "nonexistent/tree/" >tmp && + grep "^Status: 404" tmp && + grep "
Nothing matches this url
" tmp && + cgit_query "q=nonexistent" >tmp && + grep "^Status: 404" tmp && + grep "
No repositories found
" tmp +' + # The index sorts by a column only when asked, which nothing else exercises. test_expect_success 'the index sorts by a column on request' ' cgit_query "s=name" >tmp && -- cgit 2.12.1