comparison tests/test-ancestor.py.out @ 40959:d097dd0afc19

rust: translation of missingancestors This is as direct as possible a translation of the ancestor.missingancestors Python class in pure Rust. The goal for this changeset is to make it easy to compare with the Python version. We also add to Python tests the cases that helped us develop and debug this implementation. Some possible optimizations are marked along the way as TODO comments Differential Revision: https://phab.mercurial-scm.org/D5416
author Georges Racinet <gracinet@anybox.fr>
date Fri, 30 Nov 2018 00:46:55 +0100
parents bdb177923291
children
comparison
equal deleted inserted replaced
40958:abd7b75e80bc 40959:d097dd0afc19
1 % removeancestorsfrom(), example 1
2 remaining (sorted): [5, 6, 8, 9]
3 % removeancestorsfrom(), example 2
4 remaining (sorted): [11, 12, 13, 14]
5 % removeancestorsfrom(), example 3
6 remaining (sorted): [3, 5]
7 % missingancestors(), example 1
8 return [3, 7, 11]
9 % missingancestors(), example 2
10 return [5, 10]
11 % missingancestors(), example 3
12 return [3, 6, 9, 11]
13 % removeancestorsfrom(), bigger graph
14 Ok
1 % lazy ancestor set for [], stoprev = 0, inclusive = False 15 % lazy ancestor set for [], stoprev = 0, inclusive = False
2 membership: [] 16 membership: []
3 iteration: [] 17 iteration: []
4 % lazy ancestor set for [11, 13], stoprev = 0, inclusive = False 18 % lazy ancestor set for [11, 13], stoprev = 0, inclusive = False
5 membership: [7, 8, 3, 4, 1, 0] 19 membership: [7, 8, 3, 4, 1, 0]