1 BEGIN { delete $ENV{PERL_STRICTURES_EXTRA} }
6 plan skip_all => 'Extra tests disabled on perls <= 5.008003' unless "$]" >= 5.008_004;
13 %extras = map { $_ => 1 } qw(
16 bareword/filehandles.pm
25 sub indirect::unimport {
30 for my $version ( 1, 2 ) {
32 my $tempdir = File::Temp::tempdir('strictures-XXXXXX', CLEANUP => 1, TMPDIR => 1);
35 local $strictures::Smells_Like_VCS = undef;
38 use strictures $version;
41 ok defined $strictures::Smells_Like_VCS, "VCS dir has been checked (v$version)";
42 ok !$strictures::Smells_Like_VCS, "VCS dir not detected with no .git (v$version)";
47 local $strictures::Smells_Like_VCS = undef;
50 use strictures $version;
53 ok defined $strictures::Smells_Like_VCS, "VCS dir has been checked (v$version)";
54 ok $strictures::Smells_Like_VCS, "VCS dir detected with .git (v$version)";
60 local $strictures::Smells_Like_VCS = 1;
69 ["lib/module.pm" => 1],
70 ["other/one.pl" => 0],
71 ["other/t/test.t" => 0],
72 ["blib/module.pm" => 1],
74 my ($file, $want) = @$check;
78 use strictures $version;
81 my $not = $want ? '' : ' not';
83 "file named $file does$not get extras (v$version)";
87 local $ENV{PERL_STRICTURES_EXTRA} = 1;
88 local %strictures::extra_load_states = ();
90 die "Can't locate $_[1] in \@INC (...).\n"
98 open my $fh, '>', \(my $str = '');
103 #line 1 "t/load_fail.t"
104 use strictures $version;
108 die $e if defined $e;
112 qr/Missing were:\n\n indirect multidimensional bareword::filehandles/,
113 "failure to load all three extra deps is reported (v$version)"
118 open my $fh, '>', \(my $str = '');
123 #line 1 "t/load_fail.t"
124 use strictures $version;
128 die $e if defined $e;
130 is $str, '', "extra dep load failure is not reported a second time (v$version)";