diff options
author | Craig A. Berry <craigberry@mac.com> | 2013-02-23 12:45:11 -0600 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2013-02-23 12:45:11 -0600 |
commit | 95725928451f4350a7d74edda9a27b8c1d3382fb (patch) | |
tree | 5d169905a7e6009d40aca79b3ade3f616ec618d9 /t/op/magic.t | |
parent | 7c25cd544bc7d33fb15d10973aa9a30fdd5fa624 (diff) | |
download | perl-95725928451f4350a7d74edda9a27b8c1d3382fb.tar.gz |
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.
Diffstat (limited to 't/op/magic.t')
-rw-r--r-- | 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 d06fcaa34d..26b5b042fe 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'}; } } |