1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-06 02:23:03 +00:00

Add sort tests.

This commit is contained in:
Calvin Rose
2021-01-03 16:45:37 -06:00
parent 81f62b246c
commit 2ca9300bf7
2 changed files with 7 additions and 2 deletions

View File

@@ -288,4 +288,10 @@
(assert (deep= (map + [1 2 3] [10 20 30] [100 200 300] [1000 2000 3000]) @[1111 2222 3333]))
(assert (deep= (map + [1 2 3] [10 20 30] [100 200 300] [1000 2000 3000] [10000 20000 30000]) @[11111 22222 33333]))
# Sort function
(assert (deep=
(range 99)
(sort (mapcat (fn [[x y z]] [z y x]) (partition 3 (range 99))))) "sort 5")
(assert (<= ;(sort (map (fn [x] (math/random)) (range 1000)))) "sort 6")
(end-suite)