resolve intake: subscribe order within one diff is not a contract
This commit is contained in:
parent
581b29b58f
commit
a4f94ee5bc
1 changed files with 6 additions and 2 deletions
|
|
@ -225,7 +225,9 @@ fn interests_follow_what_the_held_trees_read() {
|
|||
rig.offer(&b1);
|
||||
let (one, two) = (comp_address("one"), comp_address("two"));
|
||||
// One subscription per address however many surfaces read it.
|
||||
assert_eq!(rig.interest_calls(), vec![(true, one.clone()), (true, two.clone())]);
|
||||
let held = rig.interest_calls();
|
||||
assert_eq!(held.len(), 2);
|
||||
assert!(held.contains(&(true, one.clone())) && held.contains(&(true, two.clone())));
|
||||
|
||||
// Changes and re-applies never resubscribe what is held.
|
||||
rig.put(&composition("one", "1b"));
|
||||
|
|
@ -235,7 +237,9 @@ fn interests_follow_what_the_held_trees_read() {
|
|||
|
||||
// A new version that stops reading `two` lets it go; `one` is untouched.
|
||||
rig.offer(&surface("a", 2, vec![use_of("u1", "one")]));
|
||||
assert_eq!(rig.interest_calls(), vec![(true, one.clone()), (true, two.clone()), (false, two.clone())]);
|
||||
let mut expected = held.clone();
|
||||
expected.push((false, two.clone()));
|
||||
assert_eq!(rig.interest_calls(), expected);
|
||||
|
||||
// A shared address is released only when its last reader goes.
|
||||
rig.apply(Change::Delete(surface_address(&a1)));
|
||||
|
|
|
|||
Loading…
Reference in a new issue