diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-17 20:57:24 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-17 20:57:24 +0000 |
| commit | 8410c4dc5bfbb450ea740be42e0f0d712bf86e7a (patch) | |
| tree | 27104d22c9b3d064d08379526107ccd312400d19 /test | |
| parent | 67ee2510834e576b20a82a0692fab2b2332a85c1 (diff) | |
| download | puppet-8410c4dc5bfbb450ea740be42e0f0d712bf86e7a.tar.gz puppet-8410c4dc5bfbb450ea740be42e0f0d712bf86e7a.tar.xz puppet-8410c4dc5bfbb450ea740be42e0f0d712bf86e7a.zip | |
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
Diffstat (limited to 'test')
| -rwxr-xr-x | test/other/pgraph.rb | 9 |
1 files changed, 5 insertions, 4 deletions
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 |
