1 BEGIN { $ENV{PERL_STRICTURES_EXTRA} = 0 }
3 use Test::More qw(no_plan);
5 our ($hints, $warning_bits);
8 # ignore lexicalized hints
9 $hints = $^H & ~ 0x20000;
10 $warning_bits = defined ${^WARNING_BITS} ? (unpack "H*", ${^WARNING_BITS}) : undef;
15 my $want_hints = $hints;
16 my $want_bits = $warning_bits;
18 is($hints, $want_hints, "Hints ok for $name");
19 is($warning_bits, $want_bits, "Warnings ok for $name");
24 use warnings FATAL => 'all';
25 BEGIN { capture_hints }
30 BEGIN { test_hints "version 1" }
36 warnings->import('all');
37 warnings->import(FATAL => @strictures::WARNING_CATEGORIES);
38 warnings->unimport(FATAL => @strictures::V2_NONFATAL);
39 warnings->import(@strictures::V2_NONFATAL);
40 warnings->unimport(@strictures::V2_DISABLE);
42 BEGIN { capture_hints }
47 BEGIN { test_hints "version 2" }
51 eval { $v = strictures->VERSION; 1 } or diag $@;
52 is $v, $strictures::VERSION, '->VERSION returns version correctly';
54 eval q{ use strictures 3; };
56 like $@, qr/strictures version 3 required/,
57 "Can't use strictures 3 (this is version 2)";