4 use Test::More tests => 8;
8 use File::Spec::Functions;
12 my $path = catdir( getcwd(), 't', 'data', 'octetstream' );
14 for ( my $i = 1 ; $i <= 2 ; $i++ ) {
16 my $test = sprintf( "%.3d", $i );
17 my $headers = YAML::LoadFile( catfile( $path, "$test-headers.yml" ) );
19 slurp_fh( IO::File->new( catfile( $path, "$test-results.dat" ) ) );
20 my $content = IO::File->new( catfile( $path, "$test-content.dat" ) );
21 my $body = HTTP::Body->new( $headers->{'Content-Type'},
22 $headers->{'Content-Length'} );
24 binmode $content, ':raw';
26 while ( $content->read( my $buffer, 1024 ) ) {
30 isa_ok( $body->body, 'File::Temp', "$test OctetStream body isa" );
31 my $data = slurp_fh( $body->body );
32 is_deeply( $data, $results, "$test UrlEncoded body" );
33 cmp_ok( $body->state, 'eq', 'done', "$test UrlEncoded state" );
36 $headers->{'Content-Length'},
37 "$test UrlEncoded length"
44 while ( $fh->read( my $buffer, 1024 ) ) {