diff options
author | Dirk Gadsden <dirk@esherido.com> | 2019-08-15 11:57:32 -0700 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2019-08-16 17:11:11 +0100 |
commit | 4034b4c079569c1af06ca30ef16ec1f1762ede7f (patch) | |
tree | e1b964b7cbe66d0cdc857980102867ccfd69ce9d | |
parent | 3798acbcdef9cb2312ba21666858a1f1776198d6 (diff) | |
download | gleam_stdlib-4034b4c079569c1af06ca30ef16ec1f1762ede7f.tar.gz gleam_stdlib-4034b4c079569c1af06ca30ef16ec1f1762ede7f.zip |
Uncomment test of `list:sort` with `float:compare`
-rw-r--r-- | gen/test/gleam@list_test.erl | 4 | ||||
-rw-r--r-- | test/gleam/list_test.gleam | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/gen/test/gleam@list_test.erl b/gen/test/gleam@list_test.erl index 2411f0b..fb04d25 100644 --- a/gen/test/gleam@list_test.erl +++ b/gen/test/gleam@list_test.erl @@ -187,6 +187,10 @@ sort_test() -> gleam@list:sort([4, 3, 6, 5, 4, 1], fun gleam@int:compare/2), [1, 3, 4, 4, 5, 6] ), + gleam@expect:equal( + gleam@list:sort([4.1, 3.1, 6.1, 5.1, 4.1], fun gleam@float:compare/2), + [3.1, 4.1, 4.1, 5.1, 6.1] + ), gleam@expect:equal(gleam@list:sort([], fun gleam@int:compare/2), []). index_map_test() -> diff --git a/test/gleam/list_test.gleam b/test/gleam/list_test.gleam index 46e14ea..bb9168a 100644 --- a/test/gleam/list_test.gleam +++ b/test/gleam/list_test.gleam @@ -267,10 +267,9 @@ pub fn sort_test() { |> list:sort(_, int:compare) |> expect:equal(_, [1, 3, 4, 4, 5, 6]) - // 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]) + [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(_, int:compare) |