Subject: | Fw: patch for WWW::Mechanize 0.70 to test ok on VMS 7.3-1 with perl 5.8.1 |
To: | bug-www-mechanize [...] rt.cpan.org |
From: | PPrymmer [...] factset.com |
Date: | Fri, 12 Dec 2003 16:24:35 -0500 |
Here is a remail going to the bug-www-mechanize@rt.cpan.org
address that Andy requested.
Peter Prymmer
----- Forwarded by Peter Prymmer/FactSet on 12/12/2003 04:23 PM -----
PPrymmer@factset.
com
To
12/12/2003 04:07 andy@petdance.com
PM cc
vmsperl@perl.org
Subject
patch for WWW::Mechanize 0.70 to
test ok on VMS 7.3-1 with perl
5.8.1
Greetings Andy,
I have been asked to support your WWW::Mechanize module
on an installation of perl on a VMS system. I found that despite
the great care that you took specifying files with File::Spec -
I presume so as to be as cross platform as possible - that a few
Unix and Windows shell constructs crept into the tests for the
module that unfortunately just do not work on VMS. Enclosed
please find a patch taken with respect to WWW::Mechanize 0.70
from CPAN that allows me to obtain results of:
All tests successful, 3 tests skipped.
Files=24, Tests=267, 76 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00
CPU)
where the three tests that were skipped were the ones that
required me to have extra modules that I do not currently have
installed, namely:
user:[pprymmer.www-mechanize-0_70.t]find_link-warnings....
skipped
all skipped: Test::Warn required to test
user:[pprymmer.www-mechanize-0_70.t]find_link-warnings.t
user:[pprymmer.www-mechanize-0_70.t]pod...................
skipped
all skipped: Test::Pod 1.00 required for testing POD
user:[pprymmer.www-mechanize-0_70.t]regex-error...........
skipped
all skipped: Test::Warn required to test
user:[pprymmer.www-mechanize-0_70.t]regex-error.t
Here is the patch to the two tests t/mech-dump.t and t/referer.t that
allowed me
to obtain the "All test successful" result in clear text:
diff -ru WWW-Mechanize-0.70.orig/t/mech-dump.t WWW-Mechanize-0.70
/t/mech-dump.t
--- WWW-Mechanize-0.70.orig/t/mech-dump.t 2003-11-19 23:02:25.000000000
-0500
+++ WWW-Mechanize-0.70/t/mech-dump.t 2003-12-12 16:03:03.000000000
-0500
@@ -11,7 +11,13 @@
my $exe = File::Spec->catfile( qw( blib script mech-dump ) );
my $data = File::Spec->catfile( qw( t google.html ) );
-my $actual = `$exe --forms $data`;
+my $actual;
+if ($^O eq 'VMS') {
+ $actual = `mcr $^X "-Mblib" blib/script/mech-dump --forms
t/google.html`;
+}
+else {
+ $actual = `$exe --forms $data`;
+}
my $target = URI->new_abs( "/target-page", $data );
$target = URI::file->new_abs( $target )->as_string;
diff -ru WWW-Mechanize-0.70.orig/t/referer.t WWW-Mechanize-0.70/t/referer.t
--- WWW-Mechanize-0.70.orig/t/referer.t 2003-11-19 23:02:43.000000000
-0500
+++ WWW-Mechanize-0.70/t/referer.t 2003-12-12 16:02:58.000000000 -0500
@@ -13,8 +13,14 @@
delete $ENV{HTTP_PROXY};
# Now start a fake webserver, fork, and connect to ourselves
- open SERVER, qq'"$^X" $FindBin::Bin/referer-server |'
- or die "Couldn't spawn fake server : $!";
+ if ($^O eq 'VMS') {
+ open SERVER, qq'mcr $^X t/referer-server |'
+ or die "Couldn't spawn fake server : $!";
+ }
+ else {
+ open SERVER, qq'"$^X" $FindBin::Bin/referer-server |'
+ or die "Couldn't spawn fake server : $!";
+ }
sleep 1; # give the child some time
my $url = <SERVER>;
chomp $url;
END of patch.
And in the event that my Notes mailer wrappers the lines in odd places I'll
also enclose it as a MIME attachment:
(See attached file: www-mech-0.70.patch)
I hope that that patch, or something like it, could be incorporated into
your next release of that module. Thanks.
Peter Prymmer(See attached file: www-mech-0.70.patch)
Message body is not shown because sender requested not to inline it.