diff options
author | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-07-28 10:25:47 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-07-28 10:25:47 +0200 |
commit | 1c761d95ce3e122676f2110e57e721b7689cd4c2 (patch) | |
tree | 3f372c1ce0f9cd2a5b28ad85c0b7cc0a59510aff /t/op | |
parent | 83832992940e343002e924b1307988d2604ee165 (diff) | |
download | perl-1c761d95ce3e122676f2110e57e721b7689cd4c2.tar.gz |
Add a test for srand's return value
Diffstat (limited to 't/op')
-rw-r--r-- | t/op/srand.t | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/t/op/srand.t b/t/op/srand.t index 5753a5d0eb..34fa9af935 100644 --- a/t/op/srand.t +++ b/t/op/srand.t @@ -10,7 +10,7 @@ BEGIN { use strict; require "test.pl"; -plan(tests => 4); +plan(tests => 5); # Generate a load of random numbers. # int() avoids possible floating point error. @@ -57,3 +57,7 @@ sleep(1); # in case our srand() is too time-dependent @second_run = `$^X -le "print int rand 100 for 1..100"`; ok( !eq_array(\@first_run, \@second_run), 'srand() called automatically'); + +# check srand's return value +my $seed = srand(1764); +is( $seed, 1764, "return value" ); |