diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/op/magic.t | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/t/op/magic.t b/t/op/magic.t index c2a82115b4..d71d6b299c 100755 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -27,7 +27,7 @@ $Is_os2 = $^O eq 'os2'; $Is_Cygwin = $^O eq 'cygwin'; $PERL = ($Is_MSWin32 ? '.\perl' : './perl'); -print "1..35\n"; +print "1..38\n"; eval '$ENV{"FOO"} = "hi there";'; # check that ENV is inited inside eval if ($Is_MSWin32) { ok 1, `cmd /x /c set FOO` eq "FOO=hi there\n"; } @@ -226,3 +226,24 @@ else { ok "34 # skipped: no caseless %ENV support",1; ok "35 # skipped: no caseless %ENV support",1; } + +# Make sure Errno hasn't been prematurely autoloaded + +ok 36, !defined %Errno::; + +# Test auto-loading of Errno when %! is used + +ok 37, scalar eval q{ + my $errs = %!; + defined %Errno::; +}, $@; + + +# Make sure that Errno loading doesn't clobber $! + +undef %Errno::; +delete $INC{"Errno.pm"}; + +open(FOO, "nonesuch"); # Generate ENOENT +my %errs = %{"!"}; # Cause Errno.pm to be loaded at run-time +ok 38, ${"!"}{ENOENT}; |