Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Now I know what is aggravating about testing:

by princepawn (Parson)
on Nov 08, 2003 at 10:56 UTC ( [id://305536]=note: print w/replies, xml ) Need Help??


in reply to New testing tool in the new Test::Harness

When you are told test #18 failed and you have to do a bunch of counts of ok in the file to find the error.

One way around it is to only have one test per file. Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality

Replies are listed 'Best First'.
Re: Now I know what is aggravating about testing:
by Corion (Patriarch) on Nov 08, 2003 at 11:10 UTC

    That's why modules such as Test::More allow you to name your tests - it makes finding the offending test much easier. Of course this won't help you with old-style, handmade or bad test suites, but test names are just as variable names - it's up to the author to chose sensible names.

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

      Also, it looks like line numbers are given with (newer versions of?)Test.pm

      t/file..............ok 15/38# Failed test 16 in t/file.t at line 135 + t/file..............ok 19/38# Failed test 20 in t/file.t at line 139 + t/file..............ok 21/38# Failed test 22 in t/file.t at line 141 + t/file..............NOK 22could not append: Permission denied at t/fil +e.t line 146.
      Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality
Re: Now I know what is aggravating about testing:
by petdance (Parson) on Nov 08, 2003 at 23:28 UTC
    That's why everyone should explain what the test is doing in the comment. Instead of
    is( $stooges, 3 );
    use
    is( $stooges, 3, "Correct stooge count (in case we get Shemp too)" );
    It's about as self-documenting as you can get.

    xoxo,
    Andy

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://305536]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found