diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/list_test.gleam | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/gleam/list_test.gleam b/test/gleam/list_test.gleam index 1be4e43..4576d7f 100644 --- a/test/gleam/list_test.gleam +++ b/test/gleam/list_test.gleam @@ -79,6 +79,16 @@ pub fn filter_test() { |> should.equal([0, 3]) } +pub fn filter_map_test() { + [2, 4, 6, 1] + |> list.filter_map(fn(x) { Ok(x + 1) }) + |> should.equal([3, 5, 7, 2]) + + [2, 4, 6, 1] + |> list.filter_map(Error) + |> should.equal([]) +} + pub fn map_test() { [] |> list.map(fn(x) { x * 2 }) |