summaryrefslogtreecommitdiff
path: root/t/op/rand.t
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1994-10-17 23:00:00 +0000
committerLarry Wall <lwall@netlabs.com>1994-10-17 23:00:00 +0000
commita0d0e21ea6ea90a22318550944fe6cb09ae10cda (patch)
treefaca1018149b736b1142f487e44d1ff2de5cc1fa /t/op/rand.t
parent85e6fe838fb25b257a1b363debf8691c0992ef71 (diff)
downloadperl-a0d0e21ea6ea90a22318550944fe6cb09ae10cda.tar.gz
perl 5.000perl-5.000
[editor's note: this commit combines approximate 4 months of furious releases of Andy Dougherty and Larry Wall - see pod/perlhist.pod for details. Andy notes that; Alas neither my "Irwin AccuTrack" nor my DC 600A quarter-inch cartridge backup tapes from that era seem to be readable anymore. I guess 13 years exceeds the shelf life for that backup technology :-(. ]
Diffstat (limited to 't/op/rand.t')
-rwxr-xr-xt/op/rand.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/op/rand.t b/t/op/rand.t
new file mode 100755
index 0000000000..14e6ccfbed
--- /dev/null
+++ b/t/op/rand.t
@@ -0,0 +1,25 @@
+#!./perl
+
+#From jhi@snakemail.hut.fi Mon May 16 10:36:46 1994
+#Date: Sun, 15 May 1994 20:39:09 +0300
+#From: Jarkko Hietaniemi <jhi@snakemail.hut.fi>
+
+print "1..2\n";
+
+$n = 1000;
+
+$c = 0;
+for (1..$n) {
+ last if (rand() > 1 || rand() < 0);
+ $c++;
+}
+
+if ($c == $n) {print "ok 1\n";} else {print "not ok 1\n"}
+
+$c = 0;
+for (1..$n) {
+ last if (rand(10) > 10 || rand(10) < 0);
+ $c++;
+}
+
+if ($c == $n) {print "ok 2\n";} else {print "not ok 2\n"}