Diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0204-limits.sh | 14 |
1 file changed, 14 insertions, 0 deletions
diff --git a/tests/t0204-limits.sh b/tests/t0204-limits.sh index 7361048..5250811 100755 --- a/tests/t0204-limits.sh +++ b/tests/t0204-limits.sh @@ -194,6 +194,20 @@ test_expect_success 'every page showing a blob refuses an oversized one alike' ' done ' +# The limit is in whole kilobytes, so a blob of exactly that size is still +# within it. +test_expect_success 'a blob of exactly max-blob-size is shown' ' + printf "%01023d\n" 0 >repos/blobdiff/exact.txt && + test $(wc -c <repos/blobdiff/exact.txt) = 1024 && + git -C repos/blobdiff add exact.txt && + git -C repos/blobdiff commit -q -m exact && + for page in tree plain blob blame + do + cgit_ok blobpagesrc "url=blobdiff/$page/exact.txt" >tmp && + test_grep "00000000" tmp || return 1 + done +' + # The patch and rawdiff pages hand the work to git, whose own limit on an # inlined blob is far past max-blob-size, so the cap is passed through to it. test_expect_success 'patch and rawdiff show an oversized blob as binary' ' |
