--- On Mon, 9/11/09, David Golden <xda...@gmail.com> wrote:

> From: David Golden <xda...@gmail.com>

> I don't see any problem with require_ok.  I've found
> it useful as a
> cheap sanity check and don't see the action at a distance
> problems you
> imply.

  use Test::More tests => $gazillion;
  require_ok $some_module;
  run_gazillion_minu_one_tests();

If the require fails, you get a test failure, but the tests keep running.  
Meanwhile, you might have a *partially* compiled version of $some_module in a 
namespace and the subsequent tests can throw very strange errors (I speak from 
painful experience here).  However, if the tests scroll off the screen, perhaps 
more lines than your screen buffer provides, you might be staring at some weird 
failure in test 327 and trying to figure out why your perfectly good code is 
failing a test no matter what you try.

In short, require_ok() generally needs an "or die" after it.

Cheers,
Ovid
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://use.perl.org/~Ovid/journal/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6


Reply via email to