+ is(@left, 0, 'nothing left');
+ diag "Extraneous warnings:\n", @left if @left;
+}
+
+{
+ my $w = '';
+ local $SIG{__WARN__} = sub {
+ $w = 'more than 2 warnings' if $w;
+ $w = join '', 'warn:', @_
+ };
+ {
+ eval 'no indirect; my $x = new Foo';
+ like($w, expect('Foo'), "eval 'no indirect; my \$x = new Foo'");
+ }
+ $w = '';
+ {
+ {
+ no indirect;
+ eval 'my $x = new Bar';
+ }
+ if ($] < 5.009005) {
+ is($w, '', "eval 'no indirect; my \$x = new Bar'");
+ } else {
+ like($w, expect('Bar'), "no indirect; eval 'my \$x = new Bar'");
+ }
+ }
+}
+
+{
+ 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';