5 use lib "$FindBin::Bin/lib";
7 use Test::More tests => 12;
11 use File::Spec::Functions;
15 my $path = catdir( getcwd(), 't', 'data', 'octetstream' );
17 for ( my $i = 1 ; $i <= 3 ; $i++ ) {
19 my $test = sprintf( "%.3d", $i );
20 my $headers = PAML::LoadFile( catfile( $path, "$test-headers.pml" ) );
22 slurp_fh( IO::File->new( catfile( $path, "$test-results.dat" ) ) );
23 my $content = IO::File->new( catfile( $path, "$test-content.dat" ) );
24 my $body = HTTP::Body->new( $headers->{'Content-Type'},
25 $headers->{'Content-Length'} );
27 binmode $content, ':raw';
29 while ( $content->read( my $buffer, 1024 ) ) {
33 isa_ok( $body->body, 'File::Temp', "$test OctetStream body isa" );
34 my $data = slurp_fh( $body->body );
35 is_deeply( $data, $results, "$test UrlEncoded body" );
36 cmp_ok( $body->state, 'eq', 'done', "$test UrlEncoded state" );
39 $body->content_length,
40 "$test UrlEncoded length"
47 while ( $fh->read( my $buffer, 1024 ) ) {