Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Replace 'no_plan' with fixed number using Test::More when output is random

by Ovid (Cardinal)
on Aug 17, 2007 at 08:16 UTC ( #633244=note: print w/ replies, xml ) Need Help??


in reply to Replace 'no_plan' with fixed number using Test::More when output is random

Try this:

use Test::More tests => 1; use Dyn; use Data::Dumper; my @arr = Dyn::get_list(); is scalar(grep { qr/^\d+$/ } @arr), scalar(@arr), 'All elements from get_list() should be integers' or diag Dumper(\@arr);

Cheers,
Ovid

New address of my CGI Course.


Comment on Re: Replace 'no_plan' with fixed number using Test::More when output is random
Download Code
Re^2: Replace 'no_plan' with fixed number using Test::More when output is random
by moritz (Cardinal) on Aug 17, 2007 at 08:49 UTC
    I agree, a random number of tests is almost certainly a bad idea.

    If you have random numbers involved, it might be a good idea to run the same test a fixed number of times, depending on the exact nature of your module.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2014-09-17 15:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (89 votes), past polls