Diff options
Diffstat (limited to 'tests/t0003-cache.sh')
| -rwxr-xr-x | tests/t0003-cache.sh | 19 |
1 file changed, 19 insertions, 0 deletions
diff --git a/tests/t0003-cache.sh b/tests/t0003-cache.sh index c1b5163..3bdbe3f 100755 --- a/tests/t0003-cache.sh +++ b/tests/t0003-cache.sh @@ -264,6 +264,25 @@ test_expect_success 'an expired slot is dropped when its refill is too large' ' test_dir_is_empty cache3 ' +# MANUAL says a cache-max-slot-size of 0 removes the limit, and cgit reads one +# below 0 the same way. Each value comes after a limit the big blob page is +# well past, so the page keeps its slot only if the value read last lifts it. +test_expect_success 'a cache-max-slot-size of 0 or below lifts the limit' ' + for size in 0 -1 + do + rm -rf cache3 && mkdir cache3 && + { + echo "cache-max-slot-size=32" && + echo "cache-max-slot-size=$size" && + cat bigkeyrc + } >unlimitedrc && + cgit_ok unlimitedrc "url=bigpage/tree/big.txt" >/dev/null && + ls cache3 >unlimited.slots && + test_line_count = 1 unlimited.slots || + { echo "cache-max-slot-size=$size kept no slot" && return 1; } + done +' + # A slot past its ttl is rendered again, and the new page is both what the # request gets and what the slot keeps. The ttl is long enough that the copy # is still served after the commit, which shows the slot is in use. |
