Skip Menu |

This queue is for tickets about the HTTP-Body CPAN distribution.

Report information
The Basics
Id: 60562
Status: resolved
Priority: 0/
Queue: HTTP-Body

People
Owner: cpan [...] papercreatures.com
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.09
Fixed in: (no value)



Subject: failed test 2 in t/08multipart-suffix.t
While packaging for gentoo, a test failure was encountered in t/08multipart-suffix.t PERL_DL_NONLAZY=1 /usr/bin/perl5.12.1 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01use.t ............... ok t/02pod.t ............... skipped: set TEST_POD to enable this test t/03podcoverage.t ....... skipped: set TEST_POD to enable this test t/04critic.t ............ skipped: Critic test only for developers. t/04multipart.t ......... ok t/05urlencoded.t ........ ok t/06octetstream.t ....... ok t/07xforms.t ............ ok t/08multipart-suffix.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/6 subtests Test Summary Report ------------------- t/08multipart-suffix.t (Wstat: 256 Tests: 6 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=9, Tests=202, 2 wallclock secs ( 0.10 usr 0.03 sys + 0.88 cusr 0.12 csys = 1.13 CPU) Result: FAIL # Failed test 'tempname for upload4 has no suffix' # at t/08multipart-suffix.t line 29. # '/tmp/portage/dev-perl-HTTP-Body-1.09/temp/8MtibLv/3Wbt2DQAtO' # matches '(?-xism:\..+$)' # Looks like you failed 1 test of 6. Failed 1/9 test programs. 1/202 subtests failed. A first guess at this would be its falsely failing due to the '.' at the higher directory, and perhaps this test should be run against the *basename*, not the full path. Thanks =). -- Kent Fredric/kentnl
This patch WorksForMe enough to get tests passing, and I /think/ it more accurately tests what was meant to be tested =)
Subject: multipartpatch.patch
--- t/08multipart-suffix.t +++ t/08multipart-suffix.t @@ -27,7 +27,7 @@ ); unlike( - $uploads->{upload4}{tempname}, qr/\..+$/, + $uploads->{upload4}{tempname}, qr{\.[^/]+$}, 'tempname for upload4 has no suffix' ); }
Here's a bit more complete patch, as well as a patch for the documentation.
Subject: 0004-added-documentation-on-how-to-get-support-and-contri.patch
From d2d947ab632d48890797506dbc1d8f7dcfa3d463 Mon Sep 17 00:00:00 2001 From: Christian Walde <walde.christian@googlemail.com> Date: Thu, 7 Oct 2010 20:44:03 +0200 Subject: [PATCH 4/4] added documentation on how to get support and contribute --- dist.ini | 6 ++++++ lib/HTTP/Body.pm | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/dist.ini b/dist.ini index 7e3b8da..a16a8ec 100644 --- a/dist.ini +++ b/dist.ini @@ -19,3 +19,9 @@ IO::File = 1.14 [Prereqs / TestRequires] Test::More = 0.86 Test::Deep = 0 + +[MetaResources] +repository.web = http://dev.catalystframework.org/repos/Catalyst/trunk/HTTP-Body/ +repository.url = https://dev.catalystframework.org/repos/Catalyst/trunk/HTTP-Body/ +repository.type = svn +x_mailing_list = http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev diff --git a/lib/HTTP/Body.pm b/lib/HTTP/Body.pm index eb096b1..a432ae2 100644 --- a/lib/HTTP/Body.pm +++ b/lib/HTTP/Body.pm @@ -390,6 +390,20 @@ sub tmpdir { =back +=head1 SUPPORT + +Since its original creation this module has been taken over by the Catalyst +development team. If you want to contribute patches, these will be your +primary contact points: + +IRC: + + Join #catalyst-dev on irc.perl.org. + +Mailing Lists: + + http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev + =head1 AUTHOR Christian Hansen, C<chansen@cpan.org> -- 1.7.2.3.msysgit.0
Subject: 0002-made-multipart-suffix-extraction-more-robust-by-only.patch
From df2ca021b7a2030cbd2171fbe6b439e9d2b1e3b6 Mon Sep 17 00:00:00 2001 From: Christian Walde <walde.christian@googlemail.com> Date: Thu, 7 Oct 2010 20:35:15 +0200 Subject: [PATCH 2/4] made multipart suffix extraction more robust by only looking at the basename, which makes it possible for the test to be more specific and work on windows --- lib/HTTP/Body/MultiPart.pm | 4 +++- t/08multipart-suffix.t | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/HTTP/Body/MultiPart.pm b/lib/HTTP/Body/MultiPart.pm index 5b0adff..0296171 100644 --- a/lib/HTTP/Body/MultiPart.pm +++ b/lib/HTTP/Body/MultiPart.pm @@ -6,6 +6,7 @@ use bytes; use IO::File; use File::Temp 0.14; +use File::Spec; =head1 NAME @@ -270,7 +271,8 @@ sub handler { $part->{filename} = $filename; if ( $filename ne "" ) { - my $suffix = $filename =~ /[^.]+(\.[^\\\/]+)$/ ? $1 : q{}; + my $basename = (File::Spec->splitpath($filename))[2]; + my $suffix = $basename =~ /[^.]+(\.[^\\\/]+)$/ ? $1 : q{}; my $fh = File::Temp->new( UNLINK => 0, DIR => $self->tmpdir, SUFFIX => $suffix ); diff --git a/t/08multipart-suffix.t b/t/08multipart-suffix.t index 367db05..20ae483 100644 --- a/t/08multipart-suffix.t +++ b/t/08multipart-suffix.t @@ -54,8 +54,8 @@ my $path = catdir( getcwd(), 't', 'data', 'multipart' ); 'tempname preserves .txt suffix when dir name has .' ); - unlike( - $uploads->{upload2}{tempname}, qr/\\/, + like( + $uploads->{upload2}{tempname}, qr/[\\\/]\w+.txt$/, 'tempname only gets extension from filename, not from a directory name' ); } -- 1.7.2.3.msysgit.0