From c53cde4625aba15a5f6f660e11fe91c61f5b6e24 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sun, 27 Nov 2022 16:27:10 +0100 Subject: extend sample to sample multiple elements without replacement --- tests/test.mew | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test.mew b/tests/test.mew index 50cb6bd..e3a527a 100644 --- a/tests/test.mew +++ b/tests/test.mew @@ -44,7 +44,11 @@ (test-group "sample" (test #t ((one-of 1 2 3) (sample '(1 2 3)))) (test #t ((one-of 1 2 3) (sample #(1 2 3)))) - (test #t ((one-of '(1 . 2) '(3 . 4)) (sample (tbl 1 2 3 4))))) + (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 "ooo" (sample "ooooo" 3)) + (test #(1 2 3) (sort (sample #(1 2 3) 3) <))) (test-group "range" (test '(1 2 3) (into '() (range 1 4))) -- cgit 1.4.1