[pypy-svn] r50537 - pypy/dist/pypy/tool/algo/test

cfbolz at codespeak.net cfbolz at codespeak.net
Sat Jan 12 23:07:17 CET 2008


Author: cfbolz
Date: Sat Jan 12 23:07:16 2008
New Revision: 50537

Modified:
   pypy/dist/pypy/tool/algo/test/test_graphlib.py
Log:
a test showing a pretty bad case in the cycle finder. just increase NUM if it's
not bad enough.


Modified: pypy/dist/pypy/tool/algo/test/test_graphlib.py
==============================================================================
--- pypy/dist/pypy/tool/algo/test/test_graphlib.py	(original)
+++ pypy/dist/pypy/tool/algo/test/test_graphlib.py	Sat Jan 12 23:07:16 2008
@@ -144,6 +144,17 @@
         assert list(result[0]) == [0]
         assert list(result[1]) in ([1,2], [2,1])
 
+class TestBadCase:
+    # a complete graph
+    NUM = 30
+    edges = make_edge_dict([Edge(i, j) for i in range(NUM)
+                                       for j in range(NUM)])
+    vertices = dict.fromkeys(range(NUM))
+
+    def test_break_cycles(self):
+        result = list(break_cycles(self.edges, self.edges))
+        assert result
+
 
 class TestRandom:
     edges = make_edge_dict([Edge(random.randrange(0,100),



More information about the Pypy-commit mailing list