diff options
author | Leah Neukirchen <leah@vuxu.org> | 2023-01-02 21:28:52 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2023-01-02 21:28:52 +0100 |
commit | 31afd1f7be00fbd28ea1c66ad9411d4fdf722ea7 (patch) | |
tree | 84217bf7ccc5bd5a2cee398b2a1ee66feba811c4 /tests | |
parent | a9897295de1c5b7da066aa2693e9dbfeff282fc2 (diff) | |
download | mew-31afd1f7be00fbd28ea1c66ad9411d4fdf722ea7.tar.gz mew-31afd1f7be00fbd28ea1c66ad9411d4fdf722ea7.tar.xz mew-31afd1f7be00fbd28ea1c66ad9411d4fdf722ea7.zip |
add generic sort, sort!
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)))) |