]> git.vpit.fr Git - perl/modules/indirect.git/commitdiff
Add a TODO test for the "pragma propagating into require" issue
authorVincent Pit <vince@profvince.com>
Sat, 23 May 2009 22:26:55 +0000 (00:26 +0200)
committerVincent Pit <vince@profvince.com>
Sat, 23 May 2009 22:26:55 +0000 (00:26 +0200)
MANIFEST
t/30-scope.t
t/lib/indirect/TestRequired.pm [new file with mode: 0644]

index b97c86d434a964fe6d762e6b536d3dbf51769c6f..183e407ebb60a7ffba6f3980b8744526c0c8e4c7 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -18,3 +18,4 @@ t/91-pod.t
 t/92-pod-coverage.t
 t/95-portability-files.t
 t/99-kwalitee.t
+t/lib/indirect/TestRequired.pm
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;
 
diff --git a/t/lib/indirect/TestRequired.pm b/t/lib/indirect/TestRequired.pm
new file mode 100644 (file)
index 0000000..c27d144
--- /dev/null
@@ -0,0 +1,9 @@
+package indirect::TestRequired;
+
+BEGIN { require strict; }
+
+import strict;
+
+eval 'import strict;';
+
+1;