X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fdeprecated%2F07forking.t;fp=t%2Fdeprecated%2F07forking.t;h=0000000000000000000000000000000000000000;hb=b332ee65fb155a11c72da7544e44ee632c6f577d;hp=1bccc30bc0423a5fd58d0be889b6ac45a0827c2b;hpb=d61872c8fd0b2f3990f0f91f8fd65e61f20eff8a;p=catagits%2FHTTP-Request-AsCGI.git diff --git a/t/deprecated/07forking.t b/t/deprecated/07forking.t deleted file mode 100644 index 1bccc30..0000000 --- a/t/deprecated/07forking.t +++ /dev/null @@ -1,59 +0,0 @@ -#!perl - -use strict; -use warnings; - -use Config; -use IO::File; -use HTTP::Request; -use HTTP::Request::AsCGI; -use Test::More; - -unless ( $Config{d_fork} ) { - plan skip_all => 'This test requires a platform that supports fork()'; -} - -plan tests => 8; - -my $response; - -{ - my $r = HTTP::Request->new( GET => 'http://www.host.com/' ); - my $c = HTTP::Request::AsCGI->new($r); - - my $kid = fork(); - - unless ( defined $kid ) { - die("Can't fork() kid: $!"); - } - - unless ( $kid ) { - - $c->setup; - - print "HTTP/1.0 200 OK\n"; - print "Content-Type: text/plain\n"; - print "Status: 200\n"; - print "X-Field: 1\n"; - print "X-Field: 2\n"; - print "\n"; - print "Hello!"; - - $c->restore; - - exit(0); - } - - waitpid( $kid, 0 ); - - $response = $c->response; -} - -isa_ok( $response, 'HTTP::Response' ); -is( $response->code, 200, 'Response Code' ); -is( $response->message, 'OK', 'Response Message' ); -is( $response->protocol, 'HTTP/1.0', 'Response Protocol' ); -is( $response->content, 'Hello!', 'Response Content' ); -is( $response->content_length, 6, 'Response Content-Length' ); -is( $response->content_type, 'text/plain', 'Response Content-Type' ); -is_deeply( [ $response->header('X-Field') ], [ 1, 2 ], 'Response Header X-Field' );