Commit | Line | Data |
12852959 |
1 | #!perl |
2 | |
3 | use Test::More tests => 3; |
4 | |
5 | use strict; |
6 | use warnings; |
7 | |
8 | use HTTP::Request; |
9 | use HTTP::Request::AsCGI; |
10 | |
11 | my $r = HTTP::Request->new( POST => 'http://www.host.com/'); |
12 | $r->content('STDIN'); |
13 | $r->content_length(5); |
14 | $r->content_type('text/plain'); |
15 | |
16 | my $c = HTTP::Request::AsCGI->new($r)->setup; |
17 | |
18 | print STDOUT 'STDOUT'; |
19 | print STDERR 'STDERR'; |
20 | |
21 | $c->restore; |
22 | |
23 | is( $c->stdin->getline, 'STDIN', 'STDIN' ); |
24 | is( $c->stdout->getline, 'STDOUT', 'STDOUT' ); |
25 | is( $c->stderr->getline, 'STDERR', 'STDERR' ); |