summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-11-26 18:06:19 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-11-26 18:06:19 +0100
commit2a0f96114fb75ecf6975812a041e96f7b9d161c5 (patch)
tree5b6753580edd6aec550f8d00f7177ca1f7d453b9 /tests
parentb33a8d20e524ecf57568a3af8e814a7fb3f7dd62 (diff)
downloadmew-2a0f96114fb75ecf6975812a041e96f7b9d161c5.tar.gz
mew-2a0f96114fb75ecf6975812a041e96f7b9d161c5.tar.xz
mew-2a0f96114fb75ecf6975812a041e96f7b9d161c5.zip
add shuffle
Diffstat (limited to 'tests')
-rw-r--r--tests/test.mew5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test.mew b/tests/test.mew
index d0b5685..cf84c97 100644
--- a/tests/test.mew
+++ b/tests/test.mew
@@ -30,6 +30,11 @@
   (test #t (<= 2 (rand 2 6)))
   (test #t (< (rand 2 6) 6)))
 
+(test-group "shuffle"
+  (test #(1 2 3) (sort (shuffle #(3 2 1)) <))
+  (test #f (=? (shuffle #(1 2 3 4 5 6 7 8 9 0))
+               (shuffle #(1 2 3 4 5 6 7 8 9 0)))))
+
 (test-group "range"
   (test '(1 2 3) (into '() (range 1 4)))
   (test '() (into '() (range 4 1)))