Chromatic wrote in perl.qa :
> On Mon, 2003-11-17 at 06:54, Potozniak, Andrew wrote:
> 
>> What's stopping you from creating this global var
>> and passing it in to the function whenever it is called?
> 
> Good taste.  If it's going to be more convenient than Test::More's
> like(), go all the way and make it more convenient.

Thanks, but actually that's due to my habit of adding tests to files
that already contain hundreds of tests written by a dozen of people.
Adding a test should be made the most straightforward possible and
an interface shouldn't puzzle people.

Moreover, it's convenient, when you debug a module, to have a more
useful drop-in replacement for whatever test subroutine you have. That's
how Test::LongString::is_string works : you can get a test file, include
"use Test::LongString" at the top, and replace the offending is() by
is_string() to have more readable diagnostics. You can always tweak the
defaults later, but it's more convenient to do this by bringing the
least possible modification to the test code itself.

(That's why I can imagine accepting the default length as an argument
to Test::LongString::import().)

Reply via email to