From b33a8d20e524ecf57568a3af8e814a7fb3f7dd62 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sat, 26 Nov 2022 17:47:30 +0100 Subject: add rand --- tests/test.mew | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') 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))) -- cgit 1.4.1