Skip Menu |

This queue is for tickets about the Test-Harness CPAN distribution.

Report information
The Basics
Id: 4745
Status: resolved
Priority: 0/
Queue: Test-Harness

People
Owner: Nobody in particular
Requestors: craigberry [...] mac.com
Cc:
AdminCc:

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



Date: Tue, 23 Dec 2003 10:20:45 -0600
From: "Craig A. Berry" <craigberry [...] mac.com>
To: bug-test-harness [...] rt.cpan.org
Subject: [PATCH Test::Harness 2.38] need switches quoted on VMS
Quoting the switches on the command line in order to preserve case is necessary on VMS regardless of whether the switch contains whitespace. The attached patch to Test::Harness::Straps::_switches takes care of that and gets rid of several test failures in maintperl@21947 (and any other perl since 2.38 was brought into the core).
--- lib/Test/Harness/Straps.pm;-0 Sat Dec 13 10:39:22 2003 +++ lib/Test/Harness/Straps.pm Tue Dec 23 09:31:09 2003 @@ -374,7 +374,7 @@ # Quote all switches to prevent shell interference, or VMS downcasing for ( @derived_switches ) { - $_ = qq["$_"] if /\s/ && !/^".*"$/; + $_ = qq["$_"] if !/^".*"$/; } return join( " ", @existing_switches, @derived_switches ); }
From: craigberry [...] mac.com
On second thought, the intent seems to be to only quote switches when something that is not whitespace is present, and \s is probably a typo for \S. The patch attached here implements that understanding of what's going on.
--- lib/Test/Harness/Straps.pm;-0 Sat Dec 13 10:39:22 2003 +++ lib/Test/Harness/Straps.pm Tue Dec 23 09:31:09 2003 @@ -374,7 +374,7 @@ # Quote all switches to prevent shell interference, or VMS downcasing for ( @derived_switches ) { - $_ = qq["$_"] if /\s/ && !/^".*"$/; + $_ = qq["$_"] if /\S/ && !/^".*"$/; } return join( " ", @existing_switches, @derived_switches ); }
No, it's not a typo. /\s/ was correct. The following snippet quotes EVERY parm under VMS for you: # Quote the argument if there's any whitespace in it, or if # we're VMS, since VMS requires all parms quoted. Also, don't quote # it if it's already quoted. for ( @derived_switches ) { $_ = qq["$_"] if ((/\s/ || $self->{_is_vms}) && !/^".*"$/ ); } It's in Test::Harness 2.40.