From 8410c4dc5bfbb450ea740be42e0f0d712bf86e7a Mon Sep 17 00:00:00 2001 From: luke Date: Thu, 17 May 2007 20:57:24 +0000 Subject: Fixing #507 (behaviour in cycles) by changing the topsort algorithm. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2521 980ebf18-57e1-0310-9a29-db15c13687c0 --- test/other/pgraph.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/other/pgraph.rb b/test/other/pgraph.rb index b61241087..34ba0e18c 100755 --- a/test/other/pgraph.rb +++ b/test/other/pgraph.rb @@ -189,10 +189,11 @@ class TestPGraph < Test::Unit::TestCase graph.edge_label(:a, :b), "lost label") end - def test_check_cycle + def test_fail_on_cycle { - {:a => :b, :b => :a} => true, + {:a => :b, :b => :a, :c => :a, :d => :c} => true, # larger tree involving a smaller cycle {:a => :b, :b => :c, :c => :a} => true, + {:a => :b, :b => :a, :c => :d, :d => :c} => true, {:a => :b, :b => :c} => false, }.each do |hash, result| graph = Puppet::PGraph.new @@ -202,11 +203,11 @@ class TestPGraph < Test::Unit::TestCase if result assert_raise(Puppet::Error, "%s did not fail" % hash.inspect) do - graph.check_cycle(graph.topsort) + graph.topsort end else assert_nothing_raised("%s failed" % hash.inspect) do - graph.check_cycle(graph.topsort) + graph.topsort end end end -- cgit