Diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0204-limits.sh | 25 |
1 file changed, 20 insertions, 5 deletions
diff --git a/tests/t0204-limits.sh b/tests/t0204-limits.sh index 9b0488c..7361048 100755 --- a/tests/t0204-limits.sh +++ b/tests/t0204-limits.sh @@ -116,9 +116,24 @@ test_expect_success 'small file in the same commit still renders inline' ' ' test_expect_success 'the single-file diff page always renders in full' ' - cgit_rc limitrc "url=limits/diff/big.c" >tmp && - grep "class=.hunk." tmp && - ! grep "too large to be rendered inline" tmp + cgit_ok limitrc "url=limits/diff/big.c" >tmp && + test_grep "class=.hunk." tmp && + test_grep ! "too large to be rendered inline" tmp +' + +# Following renames empties the prefix so the diff machinery sees the whole +# commit, yet the page still shows the one file it names, so the cap has to +# come from the path asked for. The links keeping follow=1 show that the page +# took that path. +test_expect_success 'a followed single-file diff page renders in full' ' + { + echo "enable-follow-links=1" && + cat limitrc + } >followrc && + cgit_ok followrc "url=limits/diff/big.c&follow=1" >tmp && + test_grep "href=./limits/diff/big.c?follow=1." tmp && + test_grep "class=.hunk." tmp && + test_grep ! "too large to be rendered inline" tmp ' # max-diff-files counts the files in a commit rather than the lines in one, @@ -131,8 +146,8 @@ test_expect_success 'a commit changing too many files shows stat only' ' ' test_expect_success 'the single-file page is not limited by max-diff-files' ' - cgit_rc limitfilesrc "url=limits/diff/small.c" >tmp && - grep "class=.hunk." tmp + cgit_ok limitfilesrc "url=limits/diff/small.c" >tmp && + test_grep "class=.hunk." tmp ' # The patch the notice links to has to hold the change the page compared, |
