diff options
| author | Ajax <commial@gmail.com> | 2016-01-25 10:47:16 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2016-01-25 14:28:41 +0100 |
| commit | b4d46020aff6aac57b79cfcb64011bdc608854d9 (patch) | |
| tree | e52ea2c358ed662c958fcaabb3f1cffda790f7ad /test/core/graph.py | |
| parent | b3fae7887d63bcdbb18b25ade6d20f152d802005 (diff) | |
| download | miasm-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.py | 10 |
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 + |