Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0101-index.sh | 17 |
1 file changed, 17 insertions, 0 deletions
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 "<div class=.error.>No repositories found</div>" 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</a>" tmp && + test_grep ">a/y</a>" tmp && + cgit_rc prefixrc "url=a/&q=zzz" >tmp && + test_grep "^Status: 404" tmp && + test_grep "<div class=.error.>No repositories found</div>" 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() { |
