Skip to content

join calls done() twice on the iterables #9178

@lucasb-eyer

Description

@lucasb-eyer

As noticed by @ivarne in #9159. Here is a possible unittest for it:

# issue #XXX `join` calls `done()` twice on the iterables                                           
let                                                                                                 
    type JoinTest                                                                                   
        nnext::Int64                                                                                
        ndone::Int64                                                                                
    end                                                                                             
    import Base.start, Base.done, Base.next                                                         
    function Base.start(jt::JoinTest) jt.nnext=0 ; jt.ndone=0 ; 0 end                               
    function Base.done(jt::JoinTest, n) jt.ndone += 1 ; n > 3 end                                   
    function Base.next(jt::JoinTest, n) jt.nnext += 1 ; "$(jt.nnext),$(jt.ndone)", n+1 end          

    @test join(JoinTest(0,0), ";") == "1,1;2,2;3,3;4,4"                                             
end                                                                                                 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions