-----BEGIN PGP SIGNED MESSAGE-----
Moin,
On 02-Aug-02 Janek Schleicher carved into stone:
> Nicholas Clark wrote at Fri, 02 Aug 2002 11:06:47 +0200:
> Very elegant.
> I'll follow that way.
> [Allthough, I believe I'll take a syntax like
>
> use Test::ManyParams; # like srand(0) or srand(42)
> use Test::ManyParams 'randomized' # with srand(rand())
> use Test::ManyParams 'randomized', $seed; # srand($seed)
te@null:~> perl -e 'print rand(),"\n"'
0.159625336368666
te@null:~> perl -e 'print rand(),"\n"'
0.292230773325176
te@null:~> perl -e 'print rand(),"\n"'
0.708889858870865
te@null:~>
This means perl does something like srand(rand()) for you automatically. I
would suggest that Test::ManyParams leaves srand() alone, unless the user
want's a specific seed:
use Test::ManyParams; # 1 nothing or like case 2
use Test::ManyParams seed; # 2 seed = srand(rand()) done by T::MP
use Test::ManyParams seed => 5; # 3 srand(5)
seed or randomized are both good, I like the shorter one ;) You can take
your pick. A nice idea is to make the choosen seed available via
print "$Test::ManyParams::seed\n";
although strictly that should not be necc, since surely T::MP will print it
for the testsuite? (Also, I don't know how to find out the seed for the case
1, so probab�y case 1 and 2 should do the same and just do a
seed = srand(rand()).
(I did not quite understand your srand(0) or srand(42) example...what is
that supposed to accomplish?)
Best wishes,
Tels
- --
perl -MDev::Bollocks -e'print Dev::Bollocks->rand(),"\n"'
conveniently build virtual web-readiness
http://bloodgate.com/perl My current Perl projects
PGP key available on http://bloodgate.com/tels.asc or via email
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
iQEVAwUBPUsGhHcLPEOTuEwVAQFVIwf9FY2b1Ob92OnKpS081phFwv9XhttQA+xk
6kQaQhjpfmGyMTCML3FzYsMhuI3ratW7CkMPxWjuJGlYwaRHxlNFU9l0Q3kT5zMl
6rDRjh0jWlVa7TqzA8cYMbbtKFWCimAg78d/OnDx9XQNjEoka4RTIaAgLHdgx00S
PY6RVDpgH4Su1Me2zQbTABDNzK6sxaawkQL1+jEGBwkV4hIHydvggEKFjZ+usKNa
UutxaOWonWVIpR6EUpGtfa3fwY6MH49gmSFriOA3KwYzX9GtXR4I8pP84nuEVBpp
VJYzwUKKHnOnjQnUvFnJXw2L7a0JdfwPmHhXmgoc+yG6pgbVpC+dow==
=fMuj
-----END PGP SIGNATURE-----