On Thu, Feb 15, 2001 at 07:29:05AM -0500, barries wrote: > What's the benefit of maintaining a count? Perl's a lot better at it > than I am. This was already discussed on p5p (I think) but I'll repeat the basic arguments here. Why have Perl maintain the count? Its lazier, some tests don't have a determinstic number of tests (though that can be shoehorned with skip()). Most importantly, most people seem to write tests, run it, see how many "oks" there are than *then* stick in the total. This dirty little secret was admitted to by several people, including myself. Why have a static count? Rocco (I think) made the point that sometimes tests will just mysteriously never run! And if those tests came at the end of the run (or the test program aborted but exited normally for some reason) Test::Harness might think it was a successful run. Tests should be paranoid and inflexible by design. Both sides are right. So, here's what's happening - The latest Test::Harness now allows the "1..M" line to appear at the beginning *or* the end of the test program (but it must be there). This paves the way for an autocounting Test.pm. - Test.pm will have "noplan()" (or something like that) which declares that Test.pm should maintain the count and spit it out at the end. - todo will be fixed so that it works internally and externally like skip, meaning you don't have to predeclare them. So the current way will work, and a more dynamic system will be in place. > I've been very tempted to add in a todo(), that's like ok() but expects > a negative result. I don't see any reason to have to predeclare the > todo list (I mean it's ok wtih me if people want to, I just hate > counting up tests). Its already in the works. Test::Harness will be modified to regonized C<not ok 1 # todo> as well. Also, Paul brought up named tests. I name my tests, like so: 1..3 ok 1 - no floggiston detected ok 2 - have squid ok 3 - flex capacitor flexing I recently tore apart Test::Harness to prevent this from becoming an explicit no-no and I'm trying to figure out a way to make Test::Harness aware of it (it currently simply ignores it) for better failed test reports (I'd rather it reported by name than by number) as well as add it to Test.pm's interface. The patch and basic arguments are here. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-01/msg00880.html