diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/iterator_test.gleam | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/gleam/iterator_test.gleam b/test/gleam/iterator_test.gleam index 9250f9c..2c62ff4 100644 --- a/test/gleam/iterator_test.gleam +++ b/test/gleam/iterator_test.gleam @@ -298,3 +298,10 @@ pub fn zip_test() { |> iterator.to_list |> should.equal([tuple("a", 20), tuple("b", 21), tuple("c", 22)]) } + +pub fn chunk_by_test() { + iterator.from_list([1, 2, 2, 3, 4, 4, 6, 7, 7]) + |> iterator.chunk_by(fn(n) { n % 2 }) + |> iterator.to_list + |> should.equal([[1], [2, 2], [3], [4, 4, 6], [7, 7]]) +} |