This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #97466] Stop defined from propagating ref cx too far
[perl5.git] / ext / Win32CORE / t / win32core.t
CommitLineData
78ff2d7b
YST
1#!perl
2
57d226e4
YST
3use Test::More;
4BEGIN {
5 if ( $ENV{PERL_CORE} ) {
6 require Config;
7 if ( $Config::Config{extensions} !~ /(?<!\S)Win32CORE(?!\S)/ ) {
8 plan skip_all => "Win32CORE extension not built";
9 exit();
10 }
11 }
12
6bad109f 13 plan tests => 4;
57d226e4
YST
14};
15use_ok( "Win32CORE" );
ad6e06ef 16
a13010ef
JD
17# Make sure that Win32 is not yet loaded
18ok(!defined &Win32::ExpandEnvironmentStrings);
19
ad6e06ef
SH
20# [perl #42925] - Loading Win32::GetLastError() via the forwarder function
21# should not affect the last error being retrieved
22$^E = 42;
867ade39 23is(Win32::GetLastError(), $^O eq 'cygwin' ? 0 : 42, 'GetLastError() works on the first call');
a13010ef
JD
24
25# Now all Win32::* functions should be loaded
26ok(defined &Win32::ExpandEnvironmentStrings);