summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2017-03-21 15:54:08 +0000
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2017-03-25 09:35:05 +0000
commit8c07e7b839a945e1b3e14c4c037553c41508185c (patch)
tree931da0e821233255812f64f4e3458d7b1baa31c7 /t
parent3e63457f336add47ed493b21a884e49d157f440c (diff)
downloadperl-8c07e7b839a945e1b3e14c4c037553c41508185c.tar.gz
Test PERL_USE_UNSAFE_INC
Diffstat (limited to 't')
-rw-r--r--t/run/runenv.t13
1 files changed, 11 insertions, 2 deletions
diff --git a/t/run/runenv.t b/t/run/runenv.t
index 1b317ce5af..c1e1b825da 100644
--- a/t/run/runenv.t
+++ b/t/run/runenv.t
@@ -12,7 +12,7 @@ BEGIN {
skip_all_without_config('d_fork');
}
-plan tests => 104;
+plan tests => 106;
my $STDOUT = tempfile();
my $STDERR = tempfile();
@@ -301,12 +301,21 @@ is ($err, '', 'No errors when determining @INC');
my @default_inc = split /\n/, $out;
SKIP: {
- skip_if_miniperl("under miniperl", 1);
+ skip_if_miniperl("under miniperl", 3);
if ($Config{default_inc_excludes_dot}) {
ok !(grep { $_ eq '.' } @default_inc), '. is not in @INC';
+ ($out, $err) = runperl_and_capture({ PERL_USE_UNSAFE_INC => 1 }, [@dump_inc]);
+
+ is ($err, '', 'No errors when determining unsafe @INC');
+
+ my @unsafe_inc = split /\n/, $out;
+
+ ok (eq_array([@unsafe_inc], [@default_inc, '.']), '. last in unsafe @INC')
+ or diag 'Unsafe @INC is: ', @unsafe_inc;
}
else {
is ($default_inc[-1], '.', '. is last in @INC');
+ skip('Not testing unsafe @INC when it includes . by default', 2);
}
}