@@ -12,10 +12,19 @@ END { 1 while unlink $tmpfile; }
12
12
# set PERL_WIN32_INTERNET_OK=1
13
13
plan tests => $ENV {PERL_WIN32_INTERNET_OK } ? 6 : 4;
14
14
15
- ok(Win32::HttpGetFile(' nonesuch://example.com' , ' NUL:' ), " " , " 'nonesuch://' is not a real protocol" );
16
- ok(Win32::GetLastError(), ' 12006' , " correct error code for unrecognized protocol" );
17
- ok(Win32::HttpGetFile(' http://!#@!&@$' , ' NUL:' ), " " , " invalid URL" );
18
- ok(Win32::GetLastError(), ' 12005' , " correct error code for invalid URL" );
15
+ # On Cygwin the test_harness will invoke additional Win32 APIs that
16
+ # will reset the Win32::GetLastError() value, so capture it immediately.
17
+ my $LastError ;
18
+ sub HttpGetFile {
19
+ my $ok = Win32::HttpGetFile(@_ );
20
+ $LastError = Win32::GetLastError();
21
+ return $ok ;
22
+ }
23
+
24
+ ok(HttpGetFile(' nonesuch://example.com' , ' NUL:' ), " " , " 'nonesuch://' is not a real protocol" );
25
+ ok($LastError , ' 12006' , " correct error code for unrecognized protocol" );
26
+ ok(HttpGetFile(' http://!#@!&@$' , ' NUL:' ), " " , " invalid URL" );
27
+ ok($LastError , ' 12005' , " correct error code for invalid URL" );
19
28
20
29
if ($ENV {PERL_WIN32_INTERNET_OK }) {
21
30
# The digest for version 0.57 should obviously stay the same even after new versions are released
0 commit comments