summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");