diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test.mew | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test.mew b/tests/test.mew index 246f9e7..ba9c223 100644 --- a/tests/test.mew +++ b/tests/test.mew @@ -792,3 +792,14 @@ (test #t (>=? 2 1 1)) (test-error (>=? "foo" 2 #(6 7 8)))) + +(test-group "sort" + (test '(1 2 3) (sort '(3 1 2))) + (test #(1 2 3) (sort #(3 1 2))) + (test '(1 2 3) (sort '(3 1 2) <)) + (test '(3 2 1) (sort '(3 1 2) >?))) + +(test-group "sort!" + (test #(1 2 3) (loc (v #(3 1 2)) (sort! v) v)) + (test #(3 2 1) (loc (v #(3 1 2)) (sort! v >) v)) + (test-error (sort! '(3 2 1)))) |