1 BEGIN { $ENV{PERL_STRICTURES_EXTRA} = 0 }
5 my ($hints, $warning_bits);
9 # ignore lexicalized hints
10 $hints = $^H & ~ 0x20000;
11 $warning_bits = defined ${^WARNING_BITS} ? (unpack "H*", ${^WARNING_BITS}) : undef;
16 return ($hints, $warning_bits);
21 use Test::More qw(no_plan);
24 my ($code_want, $code_got, $name) = @_;
25 my ($want_hints, $want_warnings) = capture_hints $code_want;
26 my ($hints, $warnings) = capture_hints $code_got;
27 is($hints, $want_hints, "Hints correct for $name");
28 is($warnings, $want_warnings, "Warnings correct for $name");
33 use warnings FATAL => 'all';
43 use warnings FATAL => @strictures::WARNING_CATEGORIES;
44 no warnings FATAL => @strictures::V2_NONFATAL;
45 use warnings @strictures::V2_NONFATAL;
46 no warnings @strictures::V2_DISABLE;
54 eval { $v = strictures->VERSION; 1 } or diag $@;
55 is $v, $strictures::VERSION, '->VERSION returns version correctly';
57 my $next = int $v + 1;
58 eval qq{ use strictures $next; };
60 like $@, qr/strictures version $next required/,
61 "Can't use strictures $next (this is version $v)";