Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more progress tests
  • Loading branch information
kraih committed Oct 21, 2011
1 parent 90db3ce commit 325c0e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/IOLoop.pm
Expand Up @@ -681,7 +681,7 @@ Note that this method is EXPERIMENTAL and might change without warning!
Drop anything with an id.
Connections will be dropped gracefully by allowing them to finish writing all
data in their write buffer.
data in their write buffers.
=head2 C<generate_port>
Expand Down
10 changes: 9 additions & 1 deletion t/mojo/message.t
Expand Up @@ -3,7 +3,7 @@ use Mojo::Base -strict;

use utf8;

use Test::More tests => 1322;
use Test::More tests => 1330;

use File::Spec;
use File::Temp;
Expand Down Expand Up @@ -439,14 +439,22 @@ is $req->url, '/', 'right URL';

# Parse HTTP 1.1 chunked request
$req = Mojo::Message::Request->new;
is $req->content->progress, 0, 'right progress';
$req->parse("POST /foo/bar/baz.html?foo=13#23 HTTP/1.1\x0d\x0a");
is $req->content->progress, 0, 'right progress';
$req->parse("Content-Type: text/plain\x0d\x0a");
$req->parse("Transfer-Encoding: chunked\x0d\x0a\x0d\x0a");
is $req->content->progress, 0, 'right progress';
$req->parse("4\x0d\x0a");
is $req->content->progress, 3, 'right progress';
$req->parse("abcd\x0d\x0a");
is $req->content->progress, 9, 'right progress';
$req->parse("9\x0d\x0a");
is $req->content->progress, 12, 'right progress';
$req->parse("abcdefghi\x0d\x0a");
is $req->content->progress, 23, 'right progress';
$req->parse("0\x0d\x0a\x0d\x0a");
is $req->content->progress, 28, 'right progress';
ok $req->is_finished, 'request is finished';
is $req->method, 'POST', 'right method';
is $req->version, '1.1', 'right version';
Expand Down

0 comments on commit 325c0e2

Please sign in to comment.