Skip to content

Commit

Permalink
added another test
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 20, 2011
1 parent 0eff929 commit 5ecfc94
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion t/mojo/message.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use warnings;

use utf8;

use Test::More tests => 958;
use Test::More tests => 967;

use File::Spec;
use File::Temp;
Expand Down Expand Up @@ -114,6 +114,21 @@ is $req->url, '', 'right URL';
is $req->cookie('a'), undef, 'no value';
is $req->body, '', 'no content';

# Parse broken HTTP 1.1 message with start line exceeding line limit
# (alternative)
$req = Mojo::Message::Request->new;
$req->parse('GET /');
$req->parse('abcd' x (128 * 1024));
ok $req->is_done, 'request is done';
is $req->error, 'Maximum line size exceeded.', 'right error';
is $req->method, 'GET', 'right method';
is $req->version, '1.1', 'right version';
is $req->at_least_version('1.1'), 1, 'at least version 1.1';
is $req->at_least_version('1.2'), undef, 'not version 1.2';
is $req->url, '', 'right URL';
is $req->cookie('a'), undef, 'no value';
is $req->body, '', 'no content';

# Parse HTTP 1.1 start line, no headers and body
$req = Mojo::Message::Request->new;
$req->parse("GET / HTTP/1.1\x0d\x0a\x0d\x0a");
Expand Down

0 comments on commit 5ecfc94

Please sign in to comment.