Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r88443:198fd97491aa
Date: 2016-11-17 16:00 +0100
http://bitbucket.org/pypy/pypy/changeset/198fd97491aa/

Log:    Test depth_first_search

diff --git a/rpython/tool/algo/test/test_graphlib.py 
b/rpython/tool/algo/test/test_graphlib.py
--- a/rpython/tool/algo/test/test_graphlib.py
+++ b/rpython/tool/algo/test/test_graphlib.py
@@ -20,6 +20,22 @@
         'G': [],
         }
 
+    def test_depth_first_search(self):
+        # 'D' missing from the list of vertices
+        lst = depth_first_search('A', list('ABCEFG'), self.edges)
+        assert lst == [
+            ('start', 'A'),
+            ('start', 'B'),
+            ('start', 'E'),
+            ('start', 'C'),
+            ('start', 'F'),
+            ('stop', 'F'),
+            ('stop', 'C'),
+            ('stop', 'E'),
+            ('stop', 'B'),
+            ('stop', 'A'),
+        ]
+
     def test_strong_components(self):
         edges = self.edges
         saved = copy_edges(edges)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to