diff options
author | Leah Neukirchen <leah@vuxu.org> | 2022-11-28 20:25:09 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2022-11-28 20:25:09 +0100 |
commit | 73b23b27998906ec479a995434ca5b664f0c0912 (patch) | |
tree | 8a594b6d3e243760aa8767a7b0d3111d7a490972 /tests | |
parent | 81f524c408894e57e29da8f72552200b92565adc (diff) | |
download | mew-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.mew | 2 |
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) <))) |