From 1c761d95ce3e122676f2110e57e721b7689cd4c2 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Wed, 28 Jul 2010 10:25:47 +0200 Subject: Add a test for srand's return value --- t/op/srand.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 't/op/srand.t') 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" ); -- cgit v1.2.1