From: Vincent Pit Date: Fri, 5 Dec 2008 15:52:17 +0000 (+0100) Subject: Really test that no indirect 'hlagh' does not croak X-Git-Tag: v0.09~11 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=aae3f9854e79cc0d989ba60f129f8a13ed1c11fc;p=perl%2Fmodules%2Findirect.git Really test that no indirect 'hlagh' does not croak --- 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__