From: Torsten Raudssus Date: Sun, 20 Mar 2011 00:52:55 +0000 (+0000) Subject: Fixed the t/08 test X-Git-Tag: v1.12^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=05f6d2389cf075266ace8b028a946108a25399bc;hp=08160cca69ee960a312c88410dd5c5b3b376a577;p=catagits%2FHTTP-Body.git Fixed the t/08 test --- diff --git a/Changes b/Changes index 0374d61..33bee85 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ This file documents the revision history for Perl extension HTTP::Body. +1.12 Sat 19 Mar 2011 19:05:17 CET + - Fixed the t/08 test + 1.11 Tue 26 Oct 2010 14:10:00 UTC - Added param_order capability (Torsten Raudssus [GETTY]) diff --git a/dist.ini b/dist.ini index aa19c18..b8a0597 100644 --- a/dist.ini +++ b/dist.ini @@ -1,8 +1,9 @@ name = HTTP-Body -version = 1.11 +version = 1.12 author = Christian Hansen, C author = Sebastian Riedel, C author = Andy Grundman, C +author = Torsten Raudssus, C abstract = HTTP Body Parser license = Perl_5 copyright_holder = Christian Hansen diff --git a/t/08multipart-suffix.t b/t/08multipart-suffix.t index 20ae483..fadc874 100644 --- a/t/08multipart-suffix.t +++ b/t/08multipart-suffix.t @@ -21,43 +21,61 @@ my $path = catdir( getcwd(), 't', 'data', 'multipart' ); { my $uploads = uploads_for('001'); - like( - $uploads->{upload2}{tempname}, qr/\.pl$/, - 'tempname preserves .pl suffix' - ); - - unlike( - $uploads->{upload4}{tempname}, qr/\..+$/, - 'tempname for upload4 has no suffix' - ); + { + my ($volume,$directories,$file) = File::Spec->splitpath( $uploads->{upload2}{tempname} ); + like( + $file, qr/\.pl$/, + 'tempname preserves .pl suffix' + ); + } + + { + my ($volume,$directories,$file) = File::Spec->splitpath( $uploads->{upload4}{tempname} ); + unlike( + $file, qr/\..+$/, + 'tempname for upload4 has no suffix' + ); + } + } { my $uploads = uploads_for('006'); - like( - $uploads->{upload2}{tempname}, qr/\.pl$/, - 'tempname preserves .pl suffix with Windows filename' - ); + { + my ($volume,$directories,$file) = File::Spec->splitpath( $uploads->{upload2}{tempname} ); + like( + $file, qr/\.pl$/, + 'tempname preserves .pl suffix with Windows filename' + ); + } + } { my $uploads = uploads_for('014'); - like( - $uploads->{upload}{tempname}, qr/\.foo\.txt$/, - 'tempname preserves .foo.txt suffix' - ); - - like( - $uploads->{upload2}{tempname}, qr/\.txt$/, - 'tempname preserves .txt suffix when dir name has .' - ); + { + my ($volume,$directories,$file) = File::Spec->splitpath( $uploads->{upload}{tempname} ); + like( + $file, qr/\.foo\.txt$/, + 'tempname preserves .foo.txt suffix' + ); + } + + { + my ($volume,$directories,$file) = File::Spec->splitpath( $uploads->{upload2}{tempname} ); + like( + $file, qr/\.txt$/, + 'tempname preserves .txt suffix when dir name has .' + ); + } + + like( + $uploads->{upload2}{tempname}, qr/[\\\/]\w+.txt$/, + 'tempname only gets extension from filename, not from a directory name' + ); - like( - $uploads->{upload2}{tempname}, qr/[\\\/]\w+.txt$/, - 'tempname only gets extension from filename, not from a directory name' - ); } sub uploads_for {