summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2014-02-19 15:01:06 +1100
committerTony Cook <tony@develop-help.com>2014-02-19 15:40:33 +1100
commit288d0d9a6ec8b0675a11ac62d46caee83e58da11 (patch)
treee68893f0d0770cf3c9930b8e0909e67fa378b685
parentb5007f6e26f57806b7cd57419d0d81bcb5c4b787 (diff)
downloadperl-288d0d9a6ec8b0675a11ac62d46caee83e58da11.tar.gz
cygwin doesn't implement $^E (except as a read of $!)
On Cygwin, reading $^E actually reads $!, as it does on other non- VMS/Win32/OS/2 platforms. Setting it does nothing.
-rw-r--r--ext/Win32CORE/t/win32core.t20
1 files changed, 14 insertions, 6 deletions
diff --git a/ext/Win32CORE/t/win32core.t b/ext/Win32CORE/t/win32core.t
index 5eb0bc4d6d..64f2e952d8 100644
--- a/ext/Win32CORE/t/win32core.t
+++ b/ext/Win32CORE/t/win32core.t
@@ -10,17 +10,25 @@ BEGIN {
}
}
- plan tests => 4;
+ plan tests => 5;
};
use_ok( "Win32CORE" );
# Make sure that Win32 is not yet loaded
-ok(!defined &Win32::ExpandEnvironmentStrings);
+ok(!defined &Win32::ExpandEnvironmentStrings,
+ "ensure other Win32::* functions aren't loaded yet");
-# [perl #42925] - Loading Win32::GetLastError() via the forwarder function
-# should not affect the last error being retrieved
$^E = 42;
-is(Win32::GetLastError(), $^O eq 'cygwin' ? 0 : 42, 'GetLastError() works on the first call');
+ok(eval { Win32::GetLastError(); 1 }, 'GetLastError() works on the first call');
+my $sys_errno = 0 + $^E;
+SKIP: {
+ $^O eq "cygwin"
+ and skip q($^E isn't useful on cygwin), 1;
+ # [perl #42925] - Loading Win32::GetLastError() via the forwarder function
+ # should not affect the last error being retrieved
+ is($sys_errno, 42, '$^E is preserved across Win32 autoload');
+}
# Now all Win32::* functions should be loaded
-ok(defined &Win32::ExpandEnvironmentStrings);
+ok(defined &Win32::ExpandEnvironmentStrings,
+ "check other Win32::* functions are loaded");