In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/95725928451f4350a7d74edda9a27b8c1d3382fb?hp=7c25cd544bc7d33fb15d10973aa9a30fdd5fa624>
- Log ----------------------------------------------------------------- commit 95725928451f4350a7d74edda9a27b8c1d3382fb Author: Craig A. Berry <[email protected]> Date: Sat Feb 23 12:45:11 2013 -0600 Handle undef values in magic.t on VMS. 888a67f6b95603701 added a new test that failed on VMS because it expected the value of an undefined element in %ENV to be an empty string, whereas on VMS it's actually a one-byte string containing a null. This is made possible by the fact that the logical name API uses strings of known lengths, and made necessary by the fact that a zero-length value (equivalence name in VMS parlance) is not allowed. So patch up the test implementation to handle this special case. ----------------------------------------------------------------------- Summary of changes: t/op/magic.t | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/t/op/magic.t b/t/op/magic.t index d06fcaa..26b5b04 100644 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -76,7 +76,11 @@ sub env_is { Win32::SetConsoleOutputCP($cp); like $set, qr/^(?:\Q$key\E=)?\Q$val\E$/, $desc; } elsif ($Is_VMS) { - is `write sys\$output f\$trnlnm("\Q$key\E")`, "$val\n", $desc; + my $eqv = `write sys\$output f\$trnlnm("\Q$key\E")`; + # A single null byte in the equivalence string means + # an undef value for Perl, so mimic that here. + $eqv = "\n" if length($eqv) == 2 and $eqv eq "\000\n"; + is $eqv, "$val\n", $desc; } else { is `echo \$\Q$key\E`, "$val\n", $desc; } @@ -87,6 +91,7 @@ END { if ($Is_VMS) { delete $ENV{'FOO'}; delete $ENV{'__NoNeSuCh'}; + delete $ENV{'__NoNeSuCh2'}; } } -- Perl5 Master Repository
