On 7/21/06, Adriano Ferreira <[EMAIL PROTECTED]> wrote:
If I run this scriptuse Test::More; plan tests => 2; BEGIN { use_ok( 'My', 'foo' ); } ok(1); is(foo, 1); I got the output, which says nothing about the use_ok. It is not counted as a test, it does not ruin the plan, it does its job (requiring and importing a &foo subroutine). $ perl use_ok_ok.t 1..2 ok 1 ok 2 Is this expected?
No. You should have gotten an error about lacking a plan. Its a bug. The trouble seems to be is that use_ok() is for some reason inside an "eval". $^S is set and there's an "eval" sub on the call stack. I don't know why. So the croak() about not having a plan gets eaten in the eval. Doesn't make a difference if I change it to a die(). I don't know how to work around this. I'm pretty sure its not Test::More's fault. PS [email protected] is not the bug tracker for Test::More. http://rt.cpan.org is where you report bugs. Posting a "hey, is this a bug" on the mailing list is ok, but if it doesn't wind up in the bug tracker I am more likely to just drop it on the floor and never get around to it.
