Skip to content

Commit

Permalink
more tests for buffer limit
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 6, 2012
1 parent 47773e3 commit 2cbbf8f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions t/mojo/response.t
Expand Up @@ -324,7 +324,9 @@ is $res->headers->content_length, undef, 'right "Content-Length" value';
$res->parse("Content-Length: 420\x0d\x0a");
$res->parse('Content-Type: multipart/form-data; bo');
$res->parse("undary=----------0xKhTmLbOuNdArY\x0d\x0a\x0d\x0a");
ok !$res->content->is_limit_exceeded, 'limit is not exceeded';
$res->parse('a' x 200);
ok $res->content->is_limit_exceeded, 'limit is exceeded';
ok $res->is_finished, 'response is finished';
ok $res->content->is_finished, 'content is finished';
is(($res->error)[0], 'Maximum buffer size exceeded', 'right error');
Expand All @@ -345,7 +347,9 @@ is $res->headers->content_length, undef, 'right "Content-Length" value';
$res->parse("Content-Length: 1000\x0d\x0a");
$res->parse("Content-Encoding: gzip\x0d\x0a\x0d\x0a");
$res->parse('a' x 5);
ok !$res->content->is_limit_exceeded, 'limit is not exceeded';
$res->parse('a' x 995);
ok $res->content->is_limit_exceeded, 'limit is exceeded';
ok $res->is_finished, 'response is finished';
ok $res->content->is_finished, 'content is finished';
is(($res->error)[0], 'Maximum buffer size exceeded', 'right error');
Expand Down

0 comments on commit 2cbbf8f

Please sign in to comment.