summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/t/op/srand.t
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-10-27 22:15:14 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-10-27 22:15:14 +0000
commit1c0eccc3fa1085a4c45950a37b9f538e2a9007f3 (patch)
treec3d1651fc2fee87eb7fcc58e218e33b6fd3000f6 /gnu/usr.bin/perl/t/op/srand.t
parent6c39ed6825893b17d2e0b3365a3fa070968c41fa (diff)
stock perl 5.8.0 from CPAN
Diffstat (limited to 'gnu/usr.bin/perl/t/op/srand.t')
-rw-r--r--gnu/usr.bin/perl/t/op/srand.t33
1 files changed, 1 insertions, 32 deletions
diff --git a/gnu/usr.bin/perl/t/op/srand.t b/gnu/usr.bin/perl/t/op/srand.t
index 5321cde6568..5753a5d0eb8 100644
--- a/gnu/usr.bin/perl/t/op/srand.t
+++ b/gnu/usr.bin/perl/t/op/srand.t
@@ -10,7 +10,7 @@ BEGIN {
use strict;
require "test.pl";
-plan(tests => 10);
+plan(tests => 4);
# Generate a load of random numbers.
# int() avoids possible floating point error.
@@ -57,34 +57,3 @@ 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" );
-
-$seed = srand(0);
-ok( $seed, "true return value for srand(0)");
-cmp_ok( $seed, '==', 0, "numeric 0 return value for srand(0)");
-
-{
- my @warnings;
- my $b;
- {
- local $SIG{__WARN__} = sub {
- push @warnings, "@_";
- warn @_;
- };
- $b = $seed + 0;
- }
- is( $b, 0, "Quacks like a zero");
- is( "@warnings", "", "Does not warn");
-}
-
-# [perl #40605]
-{
- use warnings;
- my $w = '';
- local $SIG{__WARN__} = sub { $w .= $_[0] };
- srand(2**100);
- like($w, qr/^Integer overflow in srand at /, "got a warning");
-}