On Sun, Oct 13, 2002 at 01:40:39AM +0100, Adrian Howard wrote:
> -     In hindsight, having a 1 test default was probably a hangover from 
> JUnit thinking... I never really considered any alternatives.

I have to say I like the way this currently is... most of my test
methods only have one test ... so I'll have to go change lots of things.
And type those extra 3 chars all the time :)

That doesn't really worry me _that_ much though... if there's going to
be a serious iinterface change like this I'd rather it was now than
later! 

I'm more concerned about making no_plan the default.  Typing 'noplan'
explicitly is probably a good thing IMO - it's jarring enough to make
you think twice about it...

It works in Test::Inline because there it's much more difficult to come
up with a good interface to say how many tests you should have. But
Test::Class's interface to this, where you say for each test method how
many tests it has, is a wonderful interface. Making the specification of the 
number of tests basically optional when there's such a natural way to
specify it seems like it costs us more than it buys.

>       Seems more "perlish"... 

I can sort of see this, but I'm not sure it's much of an issue ...

>       The 'no_plan' in Test::Class isn't the same concept as the
>       'no_plan' in Test::Builder... some people have found the identical
>       naming confusing.

I don't really get this one, but maybe it's just a matter of giving
another alias for 'no_plan' here?

>       "undef" seems a nice shorthand for "undefined number of tests"

It's not really an 'undefined' number though - it's an unknown number.
It's a subtle difference, but I think it's an important one.

>       No more messy "eq 'no_plan'"

>From an external POV this doesn't really impact at all...

>       Makes it simpler for people who prefer the 'no_plan' style of
>       testing

Maybe this is what I just don't get. I'm not one of those people, so I
don't really understand why people might prefer it. Especially here
where there's such a natural way to specify them, and you're only
counting them per method, rather than over the entire test.

>       Typing "(1)" isn't too much effort and makes the # tests
>       explicit.

It's not too much effort but it is slightly more. 

I think it comes down to what each approach seems best suited for.

The current approach is least work if you have lots of methods that only
issue one test - you just define each method as : Test and you're done.

The proposed new syntax makes it easiest for people who have many tests
per method, and either have a variable number or just don't want to
specify how many there are.

My opinion is that the first is a 'better' approach, and would (All
other things being equal) be the better 'default' approach.

But I'm not hugely worried either way...

Just my rambling thoughts.

Tony


Tony

Reply via email to