aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/gleam/list_test.gleam6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/gleam/list_test.gleam b/test/gleam/list_test.gleam
index abeafdf..091bd96 100644
--- a/test/gleam/list_test.gleam
+++ b/test/gleam/list_test.gleam
@@ -590,3 +590,9 @@ pub fn take_while_test() {
|> list.take_while(fn(x) { x < 3 })
|> should.equal([1, 2])
}
+
+pub fn chunk_by_test() {
+ [1, 2, 2, 3, 4, 4, 6, 7, 7]
+ |> list.chunk_by(fn(n) { n % 2 })
+ |> should.equal([[1], [2, 2], [3], [4, 4, 6], [7, 7]])
+}