aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/topology/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/swarm/topology/tests.rs')
-rw-r--r--src/swarm/topology/tests.rs33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/swarm/topology/tests.rs b/src/swarm/topology/tests.rs
index ede3b6b..8ee83c2 100644
--- a/src/swarm/topology/tests.rs
+++ b/src/swarm/topology/tests.rs
@@ -102,7 +102,14 @@ fn random_swarms() {
if let Some(local) = live.iter().nth(rng.below(live.len())) {
let others: Vec<String> = all.iter().filter(|m| *m != local).cloned().collect();
assert_eq!(
- neighbours(&others, local, k, &is_unreachable, &is_stable),
+ neighbours(
+ &RingAndPairs,
+ &others,
+ local,
+ k,
+ &is_unreachable,
+ &is_stable
+ ),
g[local]
);
}
@@ -114,7 +121,7 @@ fn small_swarms_are_a_full_mesh() {
let ms = members(13);
for m in &ms {
assert_eq!(
- neighbours(&ms, m, 12, &all_reachable, &none_stable).len(),
+ neighbours(&RingAndPairs, &ms, m, 12, &all_reachable, &none_stable).len(),
12
);
}
@@ -254,7 +261,15 @@ fn members_on_two_transports_bridge_the_others() {
let no_stable = |_: &str| false;
let mut graph: BTreeMap<String, BTreeSet<String>> = BTreeMap::new();
for (m, own) in &transports {
- for n in neighbours_across(&transports, m, own, k, &all_reachable, &no_stable) {
+ for n in neighbours_across(
+ &RingAndPairs,
+ &transports,
+ m,
+ own,
+ k,
+ &all_reachable,
+ &no_stable,
+ ) {
assert!(
!transports[&n].is_disjoint(own),
"{m} and {n} share no transport"
@@ -274,8 +289,16 @@ fn members_on_two_transports_bridge_the_others() {
ms.iter().map(|m| (m.clone(), on(&[""]))).collect();
for m in &ms[..5] {
assert_eq!(
- neighbours_across(&one, m, &on(&[""]), k, &all_reachable, &no_stable),
- neighbours(&ms, m, k, &all_reachable, &no_stable)
+ neighbours_across(
+ &RingAndPairs,
+ &one,
+ m,
+ &on(&[""]),
+ k,
+ &all_reachable,
+ &no_stable
+ ),
+ neighbours(&RingAndPairs, &ms, m, k, &all_reachable, &no_stable)
);
}
}