Commit | Line | Data |
616f6b20 |
1 | #!perl |
2 | |
3 | BEGIN { |
4 | if ($ENV{PERL_CORE}) { |
5 | chdir 't' if -d 't'; |
6 | @INC = '../lib'; |
7 | } |
8 | require Config; |
9 | import Config; |
10 | if ($Config{'extensions'} !~ /\bOpcode\b/) { |
11 | print "1..0\n"; |
12 | exit 0; |
13 | } |
14 | # Can we load the version module ? |
15 | eval { require version; 1 } or do { |
16 | print "1..0 # no version.pm\n"; |
17 | exit 0; |
18 | }; |
19 | delete $INC{"version.pm"}; |
20 | } |
21 | |
22 | use strict; |
23 | use Test::More; |
24 | use Safe; |
25 | plan(tests => 1); |
26 | |
27 | my $c = new Safe; |
05cb221f |
28 | $c->permit(qw(require caller entereval unpack)); |
616f6b20 |
29 | my $r = $c->reval(q{ use version; 1 }); |
30 | ok( defined $r, "Can load version.pm in a Safe compartment" ) or diag $@; |