about summary refs log tree commit diff stats
path: root/test/core/graph.py
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2016-01-25 10:47:16 +0100
committerAjax <commial@gmail.com>2016-01-25 14:28:41 +0100
commitb4d46020aff6aac57b79cfcb64011bdc608854d9 (patch)
treee52ea2c358ed662c958fcaabb3f1cffda790f7ad /test/core/graph.py
parentb3fae7887d63bcdbb18b25ade6d20f152d802005 (diff)
downloadmiasm-b4d46020aff6aac57b79cfcb64011bdc608854d9.tar.gz
miasm-b4d46020aff6aac57b79cfcb64011bdc608854d9.zip
Graph: two graphs are equals if they have the same nodes and edges
Diffstat (limited to 'test/core/graph.py')
-rw-r--r--test/core/graph.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/core/graph.py b/test/core/graph.py
index 86175c91..269b721b 100644
--- a/test/core/graph.py
+++ b/test/core/graph.py
@@ -192,3 +192,13 @@ assert(sccs == {frozenset({6}),
                 frozenset({7, 8}),
                 frozenset({3}),
                 frozenset({1, 2, 4, 5, 9})})
+
+# Equality
+graph = DiGraph()
+graph.add_edge(1, 2)
+graph.add_edge(2, 3)
+graph2 = DiGraph()
+graph2.add_edge(2, 3)
+graph2.add_edge(1, 2)
+assert graph == graph2
+