summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-11-28 20:25:09 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-11-28 20:25:09 +0100
commit73b23b27998906ec479a995434ca5b664f0c0912 (patch)
tree8a594b6d3e243760aa8767a7b0d3111d7a490972 /tests
parent81f524c408894e57e29da8f72552200b92565adc (diff)
downloadmew-73b23b27998906ec479a995434ca5b664f0c0912.tar.gz
mew-73b23b27998906ec479a995434ca5b664f0c0912.tar.xz
mew-73b23b27998906ec479a995434ca5b664f0c0912.zip
sample: just shuffle if fewer elements are requested than available
Diffstat (limited to 'tests')
-rw-r--r--tests/test.mew2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test.mew b/tests/test.mew
index e3a527a..4bcce7f 100644
--- a/tests/test.mew
+++ b/tests/test.mew
@@ -47,6 +47,8 @@
   (test #t ((one-of '(1 . 2) '(3 . 4)) (sample (tbl 1 2 3 4))))
   (test #t (string? (sample "foobar" 3)))
   (test 3 (len (sample "foobar" 3)))
+  (test 2 (len (sample "fb" 3)))
+  (test "" (sample "foobar" 0))
   (test "ooo" (sample "ooooo" 3))
   (test #(1 2 3) (sort (sample #(1 2 3) 3) <)))