-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Iterators.map #34352
Add Iterators.map #34352
Changes from 8 commits
d08b151
3f0652f
ff8734a
e8f14a3
4f1e092
cf60cf2
90d8729
e6f59da
a96f1e5
b04cf45
60382d4
9d900d0
7757336
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,13 @@ end | |
@test length(zip(1:3,product(1:7,cycle(1:3)))) == 3 | ||
@test length(zip(1:3,product(1:7,cycle(1:3)),8)) == 1 | ||
|
||
# map | ||
# ---- | ||
@testset "Iterators.map" begin | ||
@test collect(Iterators.map(string, 1:3)::Base.Generator) == map(string, 1:3) | ||
@test collect(Iterators.map(tuple, 1:3, 4:6)::Base.Generator) == map(tuple, 1:3, 4:6) | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it might be good to test that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason why testing infinite iterators is interesting here? I'm testing these two invocations since |
||
|
||
# rest | ||
# ---- | ||
let s = "hello" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe cross-reference with the docstring of
Base.Generator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think
Base.Generator
is included in the documentation. This is partially why I want to addIterators.map
.