On Wed, Apr 11, 2012 at 6:32 PM, Michael G Schwern <schw...@pobox.com>wrote:

> On 2012.4.10 6:21 PM, The Sidhekin wrote:
> > * How would you rewrite a test script such as my own
> > http://cpansearch.perl.org/src/EBHANSSEN/Test-Trap-v0.2.2/t/00-load.t so
> > that it does not use use_ok()?
>
>   use Test::More tests => 1;
>
>   use Test::Trap::Builder::TempFile;
>

*cut*

  If this fails, the test script will terminate immediately:

* I won't get to know if any of the other modules loaded correctly, or how
they fail.  Less of the interesting output.
* And there will be no BAIL_OUT, so the rest of the tests will run, burying
the interesting output.  More uninteresting output.

  Which are two very annoying changes in your rewrite.  And of course,
there's more of the same in the part of the rewrite I cut.




> * Why would you? :-\
>
> Because it reads like normal Perl and doesn't rely on more code to do
> something rather simple: load a module.
>

  But it fails to DWIW: report clearly on failures.  Perhaps what it is
doing is not so simple, after all?



> But quite honestly, if use_ok() works for you, if all you need is require +
> import + test, continue to use it.  I don't plan on eliminating it.
>

  Thank you.


Eirik

Reply via email to