Diff options
| -rwxr-xr-x | tests/t0003-cache.sh | 14 |
1 file changed, 7 insertions, 7 deletions
diff --git a/tests/t0003-cache.sh b/tests/t0003-cache.sh index c37b8a2..8f72a6c 100755 --- a/tests/t0003-cache.sh +++ b/tests/t0003-cache.sh @@ -130,6 +130,11 @@ test_expect_success 'set up a repo with a page larger than the output buffer' ' echo "repo.url=bigpage" && echo "repo.path=$PWD/repos/bigpage/.git" } >bigrc && + sed -e "s|^cache-root=.*|cache-root=$PWD/cache3|" bigrc >bigkeyrc && + { + echo "cache-max-slot-size=32" && + cat bigkeyrc + } >slotsizerc && rm -rf cache2 && mkdir cache2 ' @@ -158,7 +163,6 @@ test_expect_success 'a page larger than the buffer is kept and replayed whole' ' # ever go on to use. test_expect_success 'an over-long cache key leaves no slot behind' ' rm -rf cache3 && mkdir cache3 && - sed -e "s|^cache-root=.*|cache-root=$PWD/cache3|" bigrc >bigkeyrc && long=$(awk "BEGIN{s=\"\";for(i=0;i<6000;i++)s=s \"k\"; print s}") && cgit_rc bigkeyrc "url=bigpage/&q=$long" >key.out 2>/dev/null && grep "</html>" key.out && @@ -223,14 +227,10 @@ test_expect_success 'a clone file leaves no slot behind' ' # A response past cache-max-slot-size is served whole but kept nowhere, both # on a first fill and when it would have replaced an expired slot, which is -# dropped along with it. The summary page stays under the limit set here -# while the big blob page is well past it. +# dropped along with it. The summary page stays under the 32 kilobytes +# slotsizerc allows while the big blob page is well past it. test_expect_success 'a response over cache-max-slot-size is served but not kept' ' rm -rf cache3 && mkdir cache3 && - { - echo "cache-max-slot-size=32" && - cat bigkeyrc - } >slotsizerc && cgit_rc slotsizerc "url=bigpage/tree/big.txt" >big.unkept && tail -c 200 big.unkept | grep "</html>" && test_dir_is_empty cache3 && |
