aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2019-12-12 10:47:23 +0000
committerLouis Pilfold <louis@lpil.uk>2020-05-26 19:19:29 +0100
commit20904ceb0f19d4d3fb6d8cf9a5a324c0938dc3fb (patch)
tree105d806c05b81a8eaa5d91574ab4a620178e68aa /test
parentae5730686b046cba6365989fc0f88b3b2644beee (diff)
downloadgleam_stdlib-20904ceb0f19d4d3fb6d8cf9a5a324c0938dc3fb.tar.gz
gleam_stdlib-20904ceb0f19d4d3fb6d8cf9a5a324c0938dc3fb.zip
cycle
Diffstat (limited to 'test')
-rw-r--r--test/gleam/iterator_test.gleam8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/gleam/iterator_test.gleam b/test/gleam/iterator_test.gleam
index b587d12..447e912 100644
--- a/test/gleam/iterator_test.gleam
+++ b/test/gleam/iterator_test.gleam
@@ -99,3 +99,11 @@ pub fn repeat_test() {
|> iterator.take(_, 5)
|> expect.equal(_, [1, 1, 1, 1, 1])
}
+
+pub fn cycle_test() {
+ [1, 2, 3]
+ |> iterator.from_list
+ |> iterator.cycle
+ |> iterator.take(_, 9)
+ |> expect.equal(_, [1, 2, 3, 1, 2, 3, 1, 2, 3])
+}