use strict;
require "test.pl";
-plan(tests => 5);
+plan(tests => 9);
# Generate a load of random numbers.
# int() avoids possible floating point error.
# 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");
+}