X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F20-bad.t;h=0321c20749f411c7cbc6e18d2f8d9a8a444aa3d9;hp=136b381934060d8ee22e550b8ac5f9af4a645aaa;hb=aae3f9854e79cc0d989ba60f129f8a13ed1c11fc;hpb=3da3422a177506a76087adc565afc06564df0b99 diff --git a/t/20-bad.t b/t/20-bad.t index 136b381..0321c20 100644 --- a/t/20-bad.t +++ b/t/20-bad.t @@ -68,10 +68,9 @@ eval { no indirect 'hlagh'; my $warn; local $SIG{__WARN__} = sub { $warn = join ' ', @_ }; - eval "die qq{the code compiled but it shouldn't have\n}; \$obj = new Hlagh1;"; + eval "die qq{ok\n}; \$obj = new Hlagh1;"; + is($@, "ok\n", 'no indirect "hlagh" didn\'t croak'); like($warn, qr/^Indirect\s+call\s+of\s+method\s+"new"\s+on\s+object\s+"Hlagh1"/, 'no indirect "hlagh" enables the pragma'); - eval "die qq{the code compiled but it shouldn't have\n}; \$obj = new Hlagh2;"; - like($warn, qr/^Indirect\s+call\s+of\s+method\s+"new"\s+on\s+object\s+"Hlagh2"/, 'no indirect "hlagh" doesn\'t croak'); } __DATA__