Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Show the missing repository's config does cache
An empty cache passed just as well when nothing was cached at all.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0205-config.sh | 11 |
1 file changed, 9 insertions, 2 deletions
diff --git a/tests/t0205-config.sh b/tests/t0205-config.sh index 81ab66f..5975303 100755 --- a/tests/t0205-config.sh +++ b/tests/t0205-config.sh @@ -66,13 +66,17 @@ test_expect_success 'a repo filter in the main cgitrc needs no flag' ' ! grep "about-filter" err ' +# The repository may turn up before a cached 404 would expire, so error pages +# skip the cache. A page from one that opens shows this config does cache. test_expect_success 'a repository whose path is missing answers 404' ' { echo "virtual-root=/" && echo "cache-size=1021" && echo "cache-root=$PWD/gone-cache" && echo "repo.url=gone" && - echo "repo.path=$PWD/no/such/repo/.git" + echo "repo.path=$PWD/no/such/repo/.git" && + echo "repo.url=foo" && + echo "repo.path=$PWD/repos/foo/.git" } >gonerc && mkdir -p gone-cache && for page in "" log/ commit/ "tag/&h=x" atom/ plain/f @@ -81,7 +85,10 @@ test_expect_success 'a repository whose path is missing answers 404' ' grep "^Status: 404 Not Found" tmp && grep "Failed to open gone: No such file or directory" tmp || return 1 done && - test -z "$(ls gone-cache)" + test -z "$(ls gone-cache)" && + cgit_ok gonerc "url=foo/log/" >tmp && + ls gone-cache >slots && + test_line_count = 1 slots ' test_expect_success 'a fully understood config stays silent' ' |
