Flowdock
method

test_cycle

Importance_0
v1_9_1_378 - Show latest stable - 0 notes - Class: TSortTest
test_cycle() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/tsort.rb, line 271
    def test_cycle
      h = TSortHash[{1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}]
      assert_equal([[4], [2, 3], [1]],
        h.strongly_connected_components.map {|nodes| nodes.sort})
      assert_raise(TSort::Cyclic) { h.tsort }
    end
Register or log in to add new notes.