summaryrefslogtreecommitdiff
path: root/t/run
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-09-02 01:54:25 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-09-02 20:11:22 -0700
commitdbab6833e3d616532c32dd693ac65b6272b1eda7 (patch)
tree20ff1c3a7299f349534b95735ef556eb31ac6f49 /t/run
parentf748c102230411101065d76b314da45509f393ea (diff)
downloadperl-dbab6833e3d616532c32dd693ac65b6272b1eda7.tar.gz
Get t/run/switches.t working under minitest
If things are broken enough that make_ext.pl cannot run, then mini- test may run this script before Errno.pm is generated and copied into lib/. Only one test was depending on Errno, and it is already skipped under miniperl, so load Errno at run time just before that test, instead of compile time.
Diffstat (limited to 't/run')
-rw-r--r--t/run/switches.t7
1 files changed, 5 insertions, 2 deletions
diff --git a/t/run/switches.t b/t/run/switches.t
index a2e4bad47c..09b77c7d7e 100644
--- a/t/run/switches.t
+++ b/t/run/switches.t
@@ -15,7 +15,6 @@ BEGIN { require "./test.pl"; }
plan(tests => 115);
use Config;
-use Errno qw(EACCES EISDIR);
BEGIN { eval 'use POSIX qw(setlocale LC_ALL)' }
# due to a bug in VMS's piping which makes it impossible for runperl()
@@ -123,7 +122,11 @@ SKIP: {
# Win32 won't let us open the directory, so we never get to die with
# EISDIR, which happens after open.
- my $error = do { local $! = $^O eq 'MSWin32' ? EACCES : EISDIR; "$!" };
+ require Errno;
+ import Errno qw(EACCES EISDIR);
+ my $error = do {
+ local $! = $^O eq 'MSWin32' ? &EACCES : &EISDIR; "$!"
+ };
like(
runperl( switches => [ '-c' ], args => [ $tempdir ], stderr => 1),
qr/Can't open perl script.*$tempdir.*\Q$error/s,