diff --git a/python/tests/test_topology.py b/python/tests/test_topology.py index 43b382c4bb..0a0988bf92 100644 --- a/python/tests/test_topology.py +++ b/python/tests/test_topology.py @@ -8654,12 +8654,12 @@ def verify_extend_edges(self, ts): for e in ets.edges(): # e should be in old_edges, - # but with expanded limits + # but with modified limits k = (e.parent, e.child) assert k in old_edges overlaps = False for (l, r) in old_edges[k]: - if (l >= e.left) and (r <= e.right): + if (l <= e.right) and (r >= e.left): overlaps = True assert overlaps @@ -8774,8 +8774,20 @@ def test_simple_ex(self): assert t.parent(8) == 6 self.verify_extend_edges(ts) - def test_extend_edges(self): - tables = wf.wf_sim(5, 20, deep_history=False, seed=3) + def test_wright_fisher_trees(self): + tables = wf.wf_sim(N=5, ngens=20, deep_history=False, seed=3) tables.sort() ts = tables.tree_sequence().simplify() self.verify_extend_edges(ts) + + def test_wright_fisher_trees_unsimplified(self): + tables = wf.wf_sim(N=6, ngens=22, deep_history=False, seed=4) + tables.sort() + ts = tables.tree_sequence() + self.verify_extend_edges(ts) + + def test_wright_fisher_trees_with_history(self): + tables = wf.wf_sim(N=8, ngens=15, deep_history=True, seed=5) + tables.sort() + ts = tables.tree_sequence() + self.verify_extend_edges(ts)