Lines Matching refs:srand
28 eval { $obj->srand(1) };
29 ok( $@, 'does $obj->srand die if argument is equal to one' );
30 eval { $obj->srand(1.1) };
31 ok( $@, 'does $obj->srand die if argument is greater than one' );
32 eval { $obj->srand(-0.1) };
33 ok( $@, 'does $obj->srand die if argument is less than zero' );
35 eval { $obj->srand(0) };
36 is( $@, q{}, 'does $obj->srand(0) live' );
37 eval { $obj->srand( $obj->oneish ) };
38 is( $@, q{}, 'does $obj->srand($obj->oneish) live' );
40 $obj->srand();
41 is( $obj->rand(), 0, 'testing $obj->srand() gives $obj->rand() == 0' );
43 $obj->srand( $obj->oneish );
45 'testing $obj->srand($obj->oneish) gives $obj->rand == $obj->oneish' );
47 $obj->srand(.5);
48 is( $obj->rand(), .5, 'testing $obj->srand(.5) gives $obj->rand == .5' );
50 $obj->srand(0);
51 is( $obj->rand(), 0, 'testing $obj->srand(0) gives $obj->rand == 0' );
53 $obj->srand( $obj->oneish, .3, .2, .1 );
54 ok( 1, 'setting $obj->srand(oneish,.3, .2, .1)' );
59 is( $obj->rand(), 0, 'testing $obj->rand == 0 (nothing left in $obj->srand array' );