Diff options
| -rwxr-xr-x | tests/t0303-robustness.sh | 25 |
1 file changed, 14 insertions, 11 deletions
diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index f290609..1911cf8 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -540,20 +540,23 @@ test_expect_success 'an indented comment in the mimetype file is skipped' ' grep "^Content-Type: image/x-cgit" tmp ' +# A cache that stored nothing would pass the first config whatever its ttl, +# so a second keeps the same page for ever and has to show it unchanged. test_expect_success 'a refs page named with an id is not cached for ever' ' - { - echo "cache-size=10" && - echo "cache-root=$PWD/cache" && - echo "cache-static-ttl=-1" && - echo "cache-dynamic-ttl=0" && - echo "cache-summary-ttl=0" && - grep -v "^cache-size" robrc - } >ttlrc && + cgitrc_repo ttlrc rob cache-size=10 "cache-root=$PWD/ttlcache" \ + cache-static-ttl=-1 cache-dynamic-ttl=0 cache-summary-ttl=0 && + cgitrc_repo foreverrc rob cache-size=10 "cache-root=$PWD/forevercache" \ + cache-static-ttl=-1 cache-dynamic-ttl=-1 cache-summary-ttl=0 && + mkdir ttlcache forevercache && full=$(git -C repos/rob rev-parse HEAD) && - cgit_rc ttlrc "url=rob/refs/&id=$full" >tmp && + cgit_ok ttlrc "url=rob/refs/&id=$full" >tmp && + cgit_ok foreverrc "url=rob/refs/&id=$full" >tmp && git -C repos/rob tag later HEAD && - cgit_rc ttlrc "url=rob/refs/&id=$full" >tmp && - grep ">later<" tmp + cgit_ok ttlrc "url=rob/refs/&id=$full" >tmp && + test_grep ">later<" tmp && + cgit_ok foreverrc "url=rob/refs/&id=$full" >tmp && + test_grep "<tr class=.branch.>" tmp && + test_grep ! ">later<" tmp ' test_expect_success 'the diff caps hold when the path names a directory' ' |
