diff options
Diffstat (limited to 'tests')
| -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 3e2a971..bf38fbb 100755 --- a/tests/t0003-cache.sh +++ b/tests/t0003-cache.sh @@ -212,4 +212,23 @@ test_expect_success 'an expired slot is dropped when its refill is too large' ' test_line_count = 0 refill.slots ' +# The summary page keeps a ttl of its own, while every other page that follows +# a branch rather than a pinned id takes cache-dynamic-ttl, whether or not its +# url names the branch. +test_expect_success 'pages following a branch take the dynamic ttl' ' + rm -rf cache3 && mkdir cache3 && + { + echo "cache-dynamic-ttl=0" && + cat bigkeyrc + } >dynamicrc && + CGIT_CONFIG="$PWD/dynamicrc" QUERY_STRING="url=bigpage/log/" cgit >/dev/null && + CGIT_CONFIG="$PWD/dynamicrc" QUERY_STRING="url=bigpage/log/&h=master" cgit >/dev/null && + ls cache3 >dynamic.slots && + test_line_count = 0 dynamic.slots && + CGIT_CONFIG="$PWD/dynamicrc" QUERY_STRING="url=bigpage/" cgit >/dev/null && + CGIT_CONFIG="$PWD/dynamicrc" QUERY_STRING="url=bigpage/summary/" cgit >/dev/null && + ls cache3 >summary.slots && + test_line_count = 2 summary.slots +' + test_done |
