Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 31 lines (24 sloc) 0.608 kB
3283d75 @alexmv test for 0-length flushes
alexmv authored
1 use strict;
2 use Plack::Test;
3 use HTTP::Request;
4 use Test::More;
5
6 $Plack::Test::Impl = "Server";
7 $ENV{PLACK_SERVER} = 'Starman';
8
9 my $app = sub {
10 my $env = shift;
11 return sub {
12 my $response = shift;
13 my $writer = $response->([ 200, [ 'Content-Type', 'text/plain' ]]);
14 $writer->write("Content");
15 $writer->write("");
16 $writer->write("Again");
17 $writer->close;
18 }
19 };
20
21 test_psgi $app, sub {
22 my $cb = shift;
23
24 my $req = HTTP::Request->new(GET => "http://localhost/");
25 my $res = $cb->($req);
26
27 is $res->content, "ContentAgain";
28 };
29
30 done_testing;
Something went wrong with that request. Please try again.