]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/30-scope.t
Add a TODO test for the "pragma propagating into require" issue
[perl/modules/indirect.git] / t / 30-scope.t
index e9ab48009f03cded62c02978e96a53ebe2c03413..8eb7eccb975042c5a45a9e45f339ddaca0bc2015 100644 (file)
@@ -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;