X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F22-bad-mixed.t;h=bcb9203410cef9d7b6c96e6f9c87f608f87c9d79;hb=2cba38dec0a1ccaeb6ff4119ee2af3ae634e739c;hp=57282e203afd0b02ad41d8f7654dfe7b7cf4f6e1;hpb=cbecf892237be67b5072837d7691557f8f1751e2;p=perl%2Fmodules%2Findirect.git diff --git a/t/22-bad-mixed.t b/t/22-bad-mixed.t index 57282e2..bcb9203 100644 --- a/t/22-bad-mixed.t +++ b/t/22-bad-mixed.t @@ -1,6 +1,6 @@ #!perl -T -package Dongs; +package NotEmpty; sub new; @@ -11,6 +11,8 @@ use warnings; use Test::More tests => 3 * 9; +BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} } + sub meh; my @warns; @@ -38,9 +40,12 @@ sub try { SKIP: { - skip "$_: $skip" => 9 if eval $skip; + skip "$_: $skip" => 9 if do { local $@; eval $skip }; { + local $_ = $_; + s/Pkg/Empty/g; + try "return; $prefix; use indirect; $_"; is $@, '', "use indirect: $_"; is @warns, 0, 'correct number of reports'; @@ -52,7 +57,7 @@ SKIP: { local $_ = $_; - s/Hlagh/Dongs/g; + s/Pkg/NotEmpty/g; try "return; $prefix; use indirect; $_"; is $@, '', "use indirect, defined: $_"; @@ -61,7 +66,7 @@ SKIP: try "return; $prefix; no indirect; $_"; is $@, '', "use indirect, defined: $_"; is @warns, 1, 'correct number of reports'; - like $warns[0], qr/^Indirect call of method "meh" on object "Dongs" at \(eval \d+\) line \d+/, 'report 0 is correct'; + like $warns[0], qr/^Indirect call of method "meh" on object "NotEmpty" at \(eval \d+\) line \d+/, 'report 0 is correct'; } } } @@ -69,8 +74,8 @@ SKIP: __DATA__ -meh Hlagh->new; +meh Pkg->new; #### -meh Hlagh->new(); +meh Pkg->new(); #### -meh Hlagh->new, "Wut"; +meh Pkg->new, "Wut";