monora / rgl

RGL is a framework for graph data structures and algorithms in Ruby.
https://monora.github.io/rgl/
Other
415 stars 59 forks source link

set_to_begin incorrect for graph iterator #47

Closed monora closed 5 years ago

monora commented 5 years ago

The following test currently fails for bfs_iterator:

def test_bfs_stream_protocol
    it = @dg.bfs_iterator(1)
    assert_true(it.at_beginning?)

    it.set_to_end()
    assert_true(it.at_end?)

    it.set_to_begin()
    # Initial state is not correctly set. Therefor this check fails:
    assert_true(it.at_beginning?)
end