1 BEGIN { delete $ENV{PERL_STRICTURES_EXTRA} }
6 plan skip_all => 'Extra tests disabled on perls <= 5.008003' unless "$]" >= 5.008_004;
10 use File::Path qw(mkpath rmtree);
15 %extras = map { $_ => 1 } qw(
18 bareword/filehandles.pm
27 sub indirect::unimport {
32 for my $version ( 1, 2 ) {
34 my $tempdir = File::Temp::tempdir('strictures-XXXXXX', CLEANUP => 1, TMPDIR => 1);
35 my $subtemp = File::Spec->catdir($tempdir, 'sub1', 'sub2');
39 local $strictures::Smells_Like_VCS = undef;
42 use strictures $version;
45 ok defined $strictures::Smells_Like_VCS, "VCS dir has been checked (v$version)";
46 ok !$strictures::Smells_Like_VCS, "VCS dir not detected with no .git (v$version)";
51 local $strictures::Smells_Like_VCS = undef;
54 use strictures $version;
57 ok defined $strictures::Smells_Like_VCS, "VCS dir has been checked (v$version)";
58 ok $strictures::Smells_Like_VCS, "VCS dir detected with .git (v$version)";
64 local $strictures::Smells_Like_VCS = 1;
73 ["lib/module.pm" => 1],
74 ["other/one.pl" => 0],
75 ["other/t/test.t" => 0],
76 ["blib/module.pm" => 1],
78 my ($file, $want) = @$check;
82 use strictures $version;
85 my $not = $want ? '' : ' not';
87 "file named $file does$not get extras (v$version)";
91 local $ENV{PERL_STRICTURES_EXTRA} = 1;
92 local %strictures::extra_load_states = ();
94 die "Can't locate $_[1] in \@INC (...).\n"
102 open my $fh, '>', \(my $str = '');
107 #line 1 "t/load_fail.t"
108 use strictures $version;
112 die $e if defined $e;
116 qr/Missing were:\n\n indirect multidimensional bareword::filehandles/,
117 "failure to load all three extra deps is reported (v$version)"
122 open my $fh, '>', \(my $str = '');
127 #line 1 "t/load_fail.t"
128 use strictures $version;
132 die $e if defined $e;
134 is $str, '', "extra dep load failure is not reported a second time (v$version)";