X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F01use.t;h=f99b715a5a33f5142e7b8c8413c495974f322374;hb=a9df1200d106c00ee2557adda4175445f14963a0;hp=6072013116d9801c2ca72166678ec5aa69c39f7e;hpb=aac7ca024bfb2c534a3747c7d4a6cc1c84fb8e1b;p=catagits%2FHTTP-Body.git diff --git a/t/01use.t b/t/01use.t index 6072013..f99b715 100644 --- a/t/01use.t +++ b/t/01use.t @@ -1,42 +1,9 @@ +#!perl + use Test::More 'no_plan'; use strict; -use FindBin; -use_ok 'HTTP::Body'; -use YAML 'LoadFile'; -use Path::Class; -use Data::Dumper; - -for my $format (qw/multipart urlencoded/) { - for my $match ( glob file( $FindBin::Bin, 'data', $format, '*.dat' ) ) { - my $file = file($match); - my $name = $file->basename; - $name =~ /^(\d+)-.*/; - my $num = $1; - my $headers = - LoadFile( - file( $FindBin::Bin, 'data', $format, "$num-headers.yml" ) ); - my $content = $file->open('<'); - my $body = HTTP::Body->new( $headers->{'Content-Type'}, - $headers->{'Content-Length'} ); - binmode $content; +use warnings; - while ( $content->read( my $buffer, 1024 ) ) { - $body->add($buffer); - } - if ( $ENV{HTTP_Body_Debug} ) { - warn Dumper( $body->param ); - warn Dumper( $body->upload ); - warn Dumper( $body->body ); - - warn "state : " . $body->state; - warn "length : " . $body->length; - warn "content length : " . $body->content_length; - warn "body length : " . ( $body->body->stat )[7] if $body->body; - warn "buffer : " . $body->buffer if $body->buffer; - } - ok( $body->state eq 'done' ); - } -} +use_ok 'HTTP::Body'; -1;