X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F30-scope.t;h=8eb7eccb975042c5a45a9e45f339ddaca0bc2015;hp=e9ab48009f03cded62c02978e96a53ebe2c03413;hb=3b0a87b6115bb15525313ea0dc3def689d2fb2e8;hpb=a52a1238a67d43a290a7ed147254c7330ce4b96e diff --git a/t/30-scope.t b/t/30-scope.t index e9ab480..8eb7ecc 100644 --- a/t/30-scope.t +++ b/t/30-scope.t @@ -6,7 +6,9 @@ use warnings; my $tests; BEGIN { $tests = 18 } -use Test::More tests => 1 + $tests + 1 + 2; +use Test::More tests => 1 + $tests + 1 + 2 + 2; + +use lib 't/lib'; my %wrong = map { $_ => 1 } 2, 3, 5, 7, 9, 10, 14, 15, 17, 18; @@ -67,6 +69,17 @@ sub expect { } } +{ + local $TODO = 'Need a workaround for this' if $] < 5.010001; + my @w; + { + local $SIG{__WARN__} = sub { push @w, join '', @_ }; + eval 'no indirect; use indirect::TestRequired'; + } + is $@, '', 'require test didn\'t croak'; + is_deeply \@w, [ ], 'pragma didn\'t propagate into the required file'; +} + __DATA__ my $a = new P1;