Fix test to pass en 5.6.2 (unpack is needed by version.pm there)
[p5sagit/p5-mst-13.2.git] / ext / Safe / t / safeload.t
CommitLineData
616f6b20 1#!perl
2
3BEGIN {
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
22use strict;
23use Test::More;
24use Safe;
25plan(tests => 1);
26
27my $c = new Safe;
05cb221f 28$c->permit(qw(require caller entereval unpack));
616f6b20 29my $r = $c->reval(q{ use version; 1 });
30ok( defined $r, "Can load version.pm in a Safe compartment" ) or diag $@;