1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-23 03:37:40 +00:00

Fix fiber aware combinators to use general iteration instead of fiber

specifics.
This commit is contained in:
Calvin Rose
2021-08-06 16:17:47 -05:00
parent 2e641a266d
commit bb5c3773f1
2 changed files with 21 additions and 23 deletions

View File

@@ -54,8 +54,7 @@
(assert (deep= (take 3 (generate [x :in [1 2 3 4 5]] x)) @[1 2 3]) "take from fiber")
# NB: repeatedly resuming a fiber created with `generate` includes a `nil` as
# the final element. Thus a generate of 2 elements will create an array of 3.
(assert (= (length (take 4 (generate [x :in [1 2]] x))) 3) "take from short fiber")
(assert-error :invalid-type (take 3 {}) "take 6")
(assert (= (length (take 4 (generate [x :in [1 2]] x))) 2) "take from short fiber")
# take-until