persona drain tests: a record that holds an unknown send and a send still owed owes it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-28 05:48:56 +01:00
commit cd5d1d51f6

View file

@ -371,10 +371,11 @@ fn t_l3_one_predicate_says_a_record_owes_a_send_for_the_poll_the_ack_and_the_dra
json!({ "held": ["$empty"], "owed": [] }),
json!({ "held": ["$settled"], "posted": [] }),
json!({ "held": ["$owing"], "owed": owed }),
json!({ "held": ["$sibling"], "owed": owed, "unknown_sends": [{ "room": "!a", "text": "one" }] }),
];
let each: Vec<bool> = records.iter().map(owes_send).collect();
assert_eq!(each, [false, false, false, true]);
assert_eq!(each, [false, false, false, true, true], "a record that holds an unknown send and a send still owed owes it");
assert_eq!(owes(&records), each.contains(&true));
assert_eq!(owing(&records), BTreeSet::from(["$owing"]));
assert_eq!(owing(&records), BTreeSet::from(["$owing", "$sibling"]));
assert!(!owes(&records[..3]) && owing(&records[..3]).is_empty());
}