aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/gleam/list_test.gleam15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/gleam/list_test.gleam b/test/gleam/list_test.gleam
index 25028d9..a8b58e0 100644
--- a/test/gleam/list_test.gleam
+++ b/test/gleam/list_test.gleam
@@ -1,6 +1,7 @@
import gleam/expect
import gleam/list
import gleam/int
+import gleam/float
import gleam/string
pub fn length_test() {
@@ -258,14 +259,18 @@ pub fn unique_test() {
}
pub fn sort_test() {
- list:sort([4, 3, 6, 5, 4])
+ [4, 3, 6, 5, 4]
+ |> list:sort(_, int:compare)
|> expect:equal(_, [3, 4, 4, 5, 6])
- list:sort([])
- |> expect:equal(_, [])
+ // TODO: Requires float:compare
+ // [4.1, 3.1, 6.1, 5.1, 4.1]
+ // |> list:sort(_, float:compare)
+ // |> expect:equal(_, [3.1, 4.1, 4.1, 5.1, 6.1])
- list:sort([{1, 2}, {4, 5}, {3, 2}])
- |> expect:equal(_, [{1, 2}, {3, 2}, {4, 5}])
+ []
+ |> list:sort(_, int:compare)
+ |> expect:equal(_, [])
}
pub fn index_map_test() {