X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F30-scope.t;h=e9ab48009f03cded62c02978e96a53ebe2c03413;hb=9e1c36b4c0f232d32543bae20c0510cca7c287ea;hp=2546dee6a954bac24e34c41f89d567d4e35d0205;hpb=fdc979b79c21fcaa1fdd8e9a465756510ed26e88;p=perl%2Fmodules%2Findirect.git diff --git a/t/30-scope.t b/t/30-scope.t index 2546dee..e9ab480 100644 --- a/t/30-scope.t +++ b/t/30-scope.t @@ -4,15 +4,15 @@ use strict; use warnings; my $tests; -BEGIN { $tests = 10 } +BEGIN { $tests = 18 } use Test::More tests => 1 + $tests + 1 + 2; -my %wrong = map { $_ => 1 } 2, 3, 5, 7, 9, 10; +my %wrong = map { $_ => 1 } 2, 3, 5, 7, 9, 10, 14, 15, 17, 18; sub expect { my ($pkg) = @_; - return qr/^warn:Indirect\s+call\s+of\s+method\s+"new"\s+on\s+object\s+"$pkg"/; + return qr/^warn:Indirect\s+call\s+of\s+method\s+"new"\s+on\s+object\s+"$pkg"\s+at\s+\(eval\s+\d+\)\s+line\s+\d+/; } { @@ -59,7 +59,7 @@ sub expect { no indirect; eval 'my $x = new Bar'; } - if ($] < 5.010) { + if ($] < 5.009005) { is($w, '', "eval 'no indirect; my \$x = new Bar'"); } else { like($w, expect('Bar'), "no indirect; eval 'my \$x = new Bar'"); @@ -99,3 +99,23 @@ my $h = new P8; } eval { no indirect; my $j = new P10 }; + +{ + use indirect; + new P11 do { use indirect; new P12 }; +} + +{ + use indirect; + new P13 do { no indirect; new P14 }; +} + +{ + no indirect; + new P15 do { use indirect; new P16 }; +} + +{ + no indirect; + new P17 do { no indirect; new P18 }; +}