1 use Test::More 'no_plan';
10 for my $format (qw/multipart urlencoded/) {
11 for my $match ( glob file( $FindBin::Bin, 'data', $format, '*.dat' ) ) {
12 my $file = file($match);
13 my $name = $file->basename;
18 file( $FindBin::Bin, 'data', $format, "$num-headers.yml" ) );
19 my $content = $file->open('<');
20 my $body = HTTP::Body->new( $headers->{'Content-Type'},
21 $headers->{'Content-Length'} );
24 while ( $content->read( my $buffer, 1024 ) ) {
27 if ( $ENV{HTTP_Body_Debug} ) {
28 warn Dumper( $body->param );
29 warn Dumper( $body->upload );
30 warn Dumper( $body->body );
32 warn "state : " . $body->state;
33 warn "length : " . $body->length;
34 warn "content length : " . $body->content_length;
35 warn "body length : " . ( $body->body->stat )[7] if $body->body;
36 warn "buffer : " . $body->buffer if $body->buffer;
38 ok( $body->state eq 'done' );