Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Leave the scan uncached with a negative cache-size
The page cache counts a cache-size of 0 or less as off, but scan-path
cached its list for any value other than 0, so a negative one still
wrote a list into cache-root.
Diffstat (limited to 'tests/t0003-cache.sh')
| -rwxr-xr-x | tests/t0003-cache.sh | 15 |
1 file changed, 15 insertions, 0 deletions
diff --git a/tests/t0003-cache.sh b/tests/t0003-cache.sh index fa72015..0504c88 100755 --- a/tests/t0003-cache.sh +++ b/tests/t0003-cache.sh @@ -455,4 +455,19 @@ test_expect_success 'a negative cache-scan-ttl never expires the list' ' ! grep "^repo.url=kept$" "cache5/$scanned_rc" ' +# A cache-size below zero turns the page cache off, and the scan with it, so +# the cache directory stays empty. +test_expect_success 'a negative cache-size leaves the scan uncached' ' + { + echo "virtual-root=/" && + echo "cache-root=$PWD/cache-negative" && + echo "cache-size=-1" && + echo "scan-path=$PWD/scanned" + } >negativerc && + rm -rf cache-negative && mkdir cache-negative && + cgit_rc negativerc "url=" >tmp && + grep ">one</a>" tmp && + test_dir_is_empty cache-negative +' + test_done |
