projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b5e399
)
[perl #120752] Fix t/op/coreamp.t rand test
author
Dabrien 'Dabe' Murphy
<dabe@dabe.com>
Mon, 16 Dec 2013 05:24:54 +0000
(21:24 -0800)
committer
Father Chrysostomos
<sprout@cpan.org>
Mon, 16 Dec 2013 05:29:11 +0000
(21:29 -0800)
The way it was written it would even accept an empty string as
valid output.
t/op/coreamp.t
patch
|
blob
|
history
diff --git
a/t/op/coreamp.t
b/t/op/coreamp.t
index
759654a
..
addc4bb
100644
(file)
--- a/
t/op/coreamp.t
+++ b/
t/op/coreamp.t
@@
-646,7
+646,11
@@
test_proto 'quotemeta', '$', '\$';
test_proto 'rand';
$tests += 3;
-like &CORE::rand, qr/^[.\d+-e]*\z/, '&rand';
+my $r = &CORE::rand;
+ok eval {
+ use warnings FATAL => qw{numeric uninitialized};
+ $r >= 0 && $r < 1;
+}, '&rand returns a valid number';
unlike join(" ", &CORE::rand), qr/ /, '&rand in list context';
&cmp_ok(&CORE::rand(78), qw '< 78', '&rand with 1 arg');