From: Vincent Pit Date: Sun, 18 Apr 2010 15:53:20 +0000 (+0200) Subject: Add a regression test for RT #50570 X-Git-Tag: v0.20~5 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=cd669c3d5bb3f70d040109131da334bebed3565e;p=perl%2Fmodules%2Findirect.git Add a regression test for RT #50570 --- diff --git a/MANIFEST b/MANIFEST index af5db83..5ccc288 100644 --- a/MANIFEST +++ b/MANIFEST @@ -33,3 +33,6 @@ t/lib/indirect/TestRequired1.pm t/lib/indirect/TestRequired2.pm t/lib/indirect/TestRequired3X.pm t/lib/indirect/TestRequired3Y.pm +t/lib/indirect/TestRequired4/a0.pm +t/lib/indirect/TestRequired4/b0.pm +t/lib/indirect/TestRequired4/c0.pm diff --git a/t/30-scope.t b/t/30-scope.t index ad4abc8..7f31ebb 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 + 1; +use Test::More tests => (1 + $tests + 1) + 3 + 3 + 3 + 5 + 4 + 2; BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} } @@ -153,6 +153,14 @@ sub expect { is $@, '', 'RT #47902'; } +{ + my $err = eval <<' SNIP'; + use indirect::TestRequired4::a0; + indirect::TestRequired4::a0::error(); + SNIP + like $err, qr/^Can't locate object method "new" via package "X"/, 'RT #50570'; +} + __DATA__ my $a = new P1; diff --git a/t/lib/indirect/TestRequired4/a0.pm b/t/lib/indirect/TestRequired4/a0.pm new file mode 100644 index 0000000..583f88f --- /dev/null +++ b/t/lib/indirect/TestRequired4/a0.pm @@ -0,0 +1,8 @@ +package indirect::TestRequired4::a0; +no indirect ":fatal"; +use indirect::TestRequired4::b0; +sub error { + indirect::TestRequired4::b0->get; + return $@; +} +1; diff --git a/t/lib/indirect/TestRequired4/b0.pm b/t/lib/indirect/TestRequired4/b0.pm new file mode 100644 index 0000000..0fe362d --- /dev/null +++ b/t/lib/indirect/TestRequired4/b0.pm @@ -0,0 +1,5 @@ +package indirect::TestRequired4::b0; +sub get { + eval 'require indirect::TestRequired4::c0'; +} +1; diff --git a/t/lib/indirect/TestRequired4/c0.pm b/t/lib/indirect/TestRequired4/c0.pm new file mode 100644 index 0000000..6c04262 --- /dev/null +++ b/t/lib/indirect/TestRequired4/c0.pm @@ -0,0 +1,3 @@ +package indirect::TestRequired4::c0; +new X; +1;