Geoffrey Young wrote:
I understand that your patch proposes to introduce:

use Apache::TestUtil qw(:testmore);
use Test::More;

correct?


Apache::Test, not TestUtil, but yes.

argh, right, which makes my second part of the answer mostly irrelevant since I thought you were talking about TestUtil.


There are two things:

1. :tesmore imports has nothing to do with Test::More, so that tag is
very confusing. How about fixing import() instead and use a special
optional first argument:

use Apache::TestUtil '-withtestmore';
use Test::More;

or similar?


testmore, withtestmore, whatever you want to call it.  as for the '-foo'
versus 'foo' stuff one is more standard than the other but however you
prefer is fine.

whichever is fine with me. Though please explain where did you take that standard from? I think most modules follow the followinig import convention:


- a word 'foo' usually means symbol and you'd expect to be able to use it in a form of ([EMAIL PROTECTED]&)foo.

- a tag ':foo' means, import a group of tags.

- a string '-foo' means, tell import to do something, i.e. a command.

And I prefer 'withtestmore', to imply: don't not import symbols exportable by Test::More.

2. Apache::TestUtil's ok, skip and plan aren't compatible with
Test::More's one, so I'm not sure what do you achieve with this patch.


what you get is all of Apache::Test except ok, skip, and plan.  those are
the methods that get redefined warnings and cause problems when you try to
mix the two modules (especially with fatal warnings).  in particular
Test::More requires you to use Test::More::plan() or else each of its
methods (say, is_deeply()) complains about not having called Test::More::plan().

That makes sense.

IMHO, users wanting to only use Apache::TestUtil's certain functions
while using Test::More should simply import only those functions.
Problem solved.


for the most part I (and others I have talked to) want to use just about all
the methods from each: all the have_* functions from Apache::Test as well as
the like() functions from Test::More.  if you wanted that, you would need to
hand-type 17 import methods from Apache::Test.  this eliminates the need for
that and allows for a more idiomatic usage.  simply

  use Apache::TestUtil qw(:testmore);
  use Test::More;

gives you everything from Apache::Test except those methods that collide
with Test::More.  you are then free to use Apache::TestUtil functions in
your tests while keeping with Test::More's familar plan() and ok() interface.

See you are confused just as I do :0) It's Apache::Test, not Apache::TestUtil that you are after. It was just a wrong thread to disscuss this, my head was absorbed inside TestUtil.


but whatever. I'm just trying to make userspace easier.

geoff++

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to