Ilya Martynov wrote at Fri, 02 Aug 2002 07:42:44 +0200: >>>>>> On Wed, 31 Jul 2002 21:52:17 +0200, Janek Schleicher <[EMAIL PROTECTED]> said: > > JS> [..snip..] > > JS> Thinking in general, > JS> there could be also some other features included. > JS> Let's think we'd like to test the creation of big pictures, > JS> perhaps 5_000 x 5_000. > JS> It could take a while to make a test for all pixels, > JS> but we also would like to test some of them (randomly choosen), > JS> to avoid systematic error. > > Test results should be easily reproducible. I don't think having > randomly choosen tests is good idea.
srand could be our friend. > Say you have written CPAN module. One day you get email from user > with bug report about 'make test' being failing. You ask him to rerun > test with TEST_VERBOSE=1 to see in details why it failing but surprise > - it doesn't fail anymore. Have fun finding what's get wrong. Well, failing a test this way will produce a short description of the parameters via diag, so it's also seen with 'make test'. However, it's not important for me that the parameters are really randomly choosen - allthough I still would prefer to have some before I release a module - but I'd like to write tests to avoid systematic mistakes, while it would need too long to test all scenarios. But perhaps, I should better write a function to extract them, so I could write something like all_ok {$img->color(@_) == 0} params( [ [0 .. 50_000], [0 .. 50_000] ], "1000 + bounds" ) "all pixels I looked for in the big image are black"; and I could guarantee, that params( ... ) chooses the same params for the user and for me. Greetings, Janek