Permalink
Browse files

test for 0-length flushes

  • Loading branch information...
1 parent 232f747 commit 3283d758d1cfa5f32298e0a87d482a1b5787b615 @alexmv alexmv committed with May 24, 2011
Showing with 30 additions and 0 deletions.
  1. +30 −0 t/chunked_zero_length.t
@@ -0,0 +1,30 @@
+use strict;
+use Plack::Test;
+use HTTP::Request;
+use Test::More;
+
+$Plack::Test::Impl = "Server";
+$ENV{PLACK_SERVER} = 'Starman';
+
+my $app = sub {
+ my $env = shift;
+ return sub {
+ my $response = shift;
+ my $writer = $response->([ 200, [ 'Content-Type', 'text/plain' ]]);
+ $writer->write("Content");
+ $writer->write("");
+ $writer->write("Again");
+ $writer->close;
+ }
+};
+
+test_psgi $app, sub {
+ my $cb = shift;
+
+ my $req = HTTP::Request->new(GET => "http://localhost/");
+ my $res = $cb->($req);
+
+ is $res->content, "ContentAgain";
+};
+
+done_testing;

0 comments on commit 3283d75

Please sign in to comment.