|CC:||perl5-porters [...] perl.org|
|Subject:||Test script missing from CGI.pm CPAN distribution?|
I have noticed that a change was applied to perl (maint-5.12) in Jan 2011 which modified CGI.pm itself and added two new test scripts: headers.t and multipart_init.t:The first two changes do seem to have found their way back to the CGI.pm CPAN distro, but the latter change -- the addition of multipart_init.t -- appears to have been missed. I've checked through every CPAN release from 3.48 through 3.59 and don't see it anywhere, despite the Changes file for 3.52 claiming to have fixed a logic error in it! The current bleadperl version is attached. Could you please consider including it (or a later version if you have one, perhaps including whatever fixes 3.52's Changes file was referring to?) in future releases.
use Test::More 'no_plan'; use CGI; my $q = CGI->new; my $sv = $q->multipart_init; like( $sv, qr|Content-Type: multipart/x-mixed-replace;boundary="------- =|, 'multipart_init(), basic'); like( $sv, qr/$CGI::CRLF$/, 'multipart_init(), ends in CRLF' ); $sv = $q->multipart_init( 'this_is_the_boundary' ); like( $sv, qr/boundary="this_is_the_boundary"/, 'multipart_init("simple_boundary")' ); $sv = $q->multipart_init( -boundary => 'this_is_another_boundary' ); like($sv, qr/boundary="this_is_another_boundary"/, "multipart_init( -boundary => 'this_is_another_boundary')"); $sv = $q->multipart_init; my $sv2 = $q->multipart_init; isnt($sv,$sv2,"due to random boundaries, multiple calls produce different results");