X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F30-scope.t;h=a63bf04c012eadd15f1a1191f88fc86853ef2f0b;hp=7f31ebb3f9b23bb33d56287149464505a357d529;hb=87253a0488e3ed6c69d63a8526c99e5bb9c97e59;hpb=cd669c3d5bb3f70d040109131da334bebed3565e diff --git a/t/30-scope.t b/t/30-scope.t index 7f31ebb..a63bf04 100644 --- a/t/30-scope.t +++ b/t/30-scope.t @@ -6,7 +6,7 @@ use warnings; my $tests; BEGIN { $tests = 18 } -use Test::More tests => (1 + $tests + 1) + 3 + 3 + 3 + 5 + 4 + 2; +use Test::More tests => (1 + $tests + 1) + 3 + 3 + 3 + 5 + 4 + 3; BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} } @@ -161,6 +161,12 @@ sub expect { like $err, qr/^Can't locate object method "new" via package "X"/, 'RT #50570'; } +# This test must be in the topmost scope +BEGIN { eval 'use indirect::TestRequired5::a0' } +my $err = indirect::TestRequired5::a0::error(); +like $err, qr/^Can't locate object method "new" via package "X"/, + 'identifying requires by their eval context pointer is not enough'; + __DATA__ my $a = new P1;