summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-11-26 17:47:30 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-11-26 17:47:30 +0100
commitb33a8d20e524ecf57568a3af8e814a7fb3f7dd62 (patch)
treed65285cdcf2697355b78748ebfaf174d959854d4 /tests
parent3360494dad789393fad412207dfc0b497dac887f (diff)
downloadmew-b33a8d20e524ecf57568a3af8e814a7fb3f7dd62.tar.gz
mew-b33a8d20e524ecf57568a3af8e814a7fb3f7dd62.tar.xz
mew-b33a8d20e524ecf57568a3af8e814a7fb3f7dd62.zip
add rand
Diffstat (limited to 'tests')
-rw-r--r--tests/test.mew6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test.mew b/tests/test.mew
index 904059d..d0b5685 100644
--- a/tests/test.mew
+++ b/tests/test.mew
@@ -24,6 +24,12 @@
   (test '(11 22 33) (sort (vals (tbl 1 11 2 22 3 33)) <))
   (test-error (vals #(1 2 3))))
 
+(test-group "rand"
+  (test #f (integer? (rand)))
+  (test #t (integer? (rand 6)))
+  (test #t (<= 2 (rand 2 6)))
+  (test #t (< (rand 2 6) 6)))
+
 (test-group "range"
   (test '(1 2 3) (into '() (range 1 4)))
   (test '() (into '() (range 4 1)))