From 42cbd23e8ca7ea287d7a45d80fb934b64769ca19 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Wed, 21 Dec 2016 15:23:49 -0600 Subject: [PATCH 1/2] Make the SCC unit test stricter. --- test/test_misc.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/test_misc.py b/test/test_misc.py index 384c1326b..13f1112a4 100644 --- a/test/test_misc.py +++ b/test/test_misc.py @@ -60,8 +60,15 @@ def test_compute_sccs(): return result + [node] for scc in sccs: - result = visit(scc[0]) - assert set(result) == set(scc), (set(result), set(scc)) + scc = set(scc) + assert not scc & visited + # Check that starting from each element of the SCC results + # in the same set of reachable nodes. + for scc_root in scc: + visited.difference_update(scc) + result = visit(scc_root) + assert set(result) == scc, (set(result), scc) + for nnodes in range(10, 20): for i in range(40): -- GitLab From 01fc6559343fb1f0a272a0780cf26c88b3d027d3 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Thu, 22 Dec 2016 03:36:16 -0600 Subject: [PATCH 2/2] Whitespace fix. --- test/test_misc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_misc.py b/test/test_misc.py index 13f1112a4..94d83cd29 100644 --- a/test/test_misc.py +++ b/test/test_misc.py @@ -69,7 +69,6 @@ def test_compute_sccs(): result = visit(scc_root) assert set(result) == scc, (set(result), scc) - for nnodes in range(10, 20): for i in range(40): graph = generate_random_graph(nnodes) -- GitLab