7 use lib "$FindBin::Bin/lib";
9 use Test::More tests => 3;
14 use File::Spec::Functions;
17 use File::Temp qw/ tempdir /;
19 my $path = catdir( getcwd(), 't', 'data', 'multipart' );
22 $HTTP::Body::MultiPart::basename_regexp = qr/(\.\w+(?:\.\w+)*)$/;
24 my $uploads = uploads_for('015');
27 my ($volume,$directories,$file) = File::Spec->splitpath( $uploads->{upload}{tempname} );
29 $file, qr/^.{10}\.tar\.gz\.Z$/,
30 'tempname preserves .tar.gz.Z suffix'
35 my ($volume,$directories,$file) = File::Spec->splitpath( $uploads->{upload2}{tempname} );
37 $file, qr/^.{10}\.png$/,
38 'tempname preserves .png suffix'
43 my ($volume,$directories,$file) = File::Spec->splitpath( $uploads->{upload3}{tempname} );
45 $file, qr/^.{10}\.txt$/,
46 'tempname preserves .txt suffix'
55 my $headers = PAML::LoadFile( catfile( $path, "$number-headers.pml" ) );
56 my $content = IO::File->new( catfile( $path, "$number-content.dat" ) );
57 my $body = HTTP::Body->new( $headers->{'Content-Type'}, $headers->{'Content-Length'} );
58 my $tempdir = tempdir( 'XXXXXXX', CLEANUP => 1, DIR => File::Spec->tmpdir() );
59 $body->tmpdir($tempdir);
61 binmode $content, ':raw';
63 while ( $content->read( my $buffer, 1024 ) ) {