Sha256: 863cbe817fd33c56195acb44fe64fa036031afc67b6971c4afd0e87787275f78
Contents?: true
Size: 588 Bytes
Versions: 2
Compression:
Stored size: 588 Bytes
Contents
require 'test/unit' require 'rgl/transitiv_closure' require 'test_helper' include RGL class TestTransitiveClosure < Test::Unit::TestCase def setup @dg = DirectedAdjacencyGraph.new(Array) edges = [[1,2],[2,3],[2,4],[4,5],[1,6],[6,4]] edges.each do |(src,target)| @dg.add_edge(src, target) end end def test_transitive_closure assert_equal("(1-2)(1-3)(1-4)(1-6)(2-3)(2-4)(2-5)(4-5)(6-4)(6-5)", @dg.transitive_closure.to_s) end def test_transitive_closure_undirected assert_raises(NotDirectedError) {AdjacencyGraph.new.transitive_closure} end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rgl-0.3.1 | tests/TestTransitiveClosure.rb |
rgl-0.3.0 | tests/TestTransitiveClosure.rb |