Diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0003-cache.sh | 13 |
1 file changed, 11 insertions, 2 deletions
diff --git a/tests/t0003-cache.sh b/tests/t0003-cache.sh index 618fb7d..749ca97 100755 --- a/tests/t0003-cache.sh +++ b/tests/t0003-cache.sh @@ -200,11 +200,20 @@ test_expect_success 'set up a repo missing a parent object' ' rm -rf cache4 && mkdir cache4 ' +# The visitor gets the info table the commit page had rendered, then the +# error, then the end of the page. The tree page needs no parent, and the slot +# it fills shows the cache is in use for brokenrc at all. test_expect_success 'an error after output began ends the page with it and caches nothing' ' cgit_rc brokenrc "url=broken/commit/&id=$tip" >broken.out && - grep "Not a commit" broken.out && test $(grep -c "^Status:" broken.out) = 1 && - test_dir_is_empty cache4 + sed -n -e "/<table class=.commit-info.>/s/.*/info/p" -e "/Not a commit/s/.*/error/p" \ + -e "/<\/html>/s/.*/end/p" broken.out >broken.order && + test_write_lines info error end >expect && + test_cmp expect broken.order && + test_dir_is_empty cache4 && + cgit_ok brokenrc "url=broken/tree/" >/dev/null && + ls cache4 >broken.slots && + test_line_count = 1 broken.slots ' # An error page reports a condition the repository may grow out of, and a |
