Assert complete typed activations in authoring and offset regressions

This commit is contained in:
2026-09-12 21:05:11 -07:00
parent 695685a2b1
commit 20acd3238e
2 changed files with 28 additions and 7 deletions
+17 -5
View File
@@ -3234,12 +3234,24 @@ mod tests {
.iter()
.any(|l| l.id == steps[1] && l.dashed && l.label.contains("reply"))
);
assert!(
scene
.boxes
.iter()
.any(|b| b.id == steps[0] && b.rect.width == 8.)
assert_eq!(
scene.activations,
vec![super::super::scenario_activation::Segment {
call: steps[0],
receiver,
scope: owner,
rect: Rectangle::new(
Point::new(scene.lanes[&receiver] - 6., 148.),
Size::new(12., 92.),
),
column: 0,
finish: super::super::scenario_activation::Finish::Reply(steps[1]),
}]
);
let call_line = scene.lines.iter().find(|line| line.id == steps[0]).unwrap();
let reply_line = scene.lines.iter().find(|line| line.id == steps[1]).unwrap();
assert_eq!(call_line.points.last().unwrap().y, 148.);
assert_eq!(reply_line.points.first().unwrap().y, 240.);
let mut reply = State::default();
reply
.update(result, Event::Start(owner, Tool::Message))
@@ -443,8 +443,8 @@ fn test_only_upstream_row_offsets_update_lifetime_segments_and_endpoints_without
let birth = f.message(f.owner, MessageKind::Create);
let c1 = f.message(f.owner, MessageKind::Call);
let c2 = f.message(f.owner, MessageKind::Call);
f.reply(f.owner, c2);
f.reply(f.owner, c1);
let r2 = f.reply(f.owner, c2);
let r1 = f.reply(f.owner, c1);
let death = f.message(f.owner, MessageKind::Delete);
let document = f.document();
let before = document.snapshot();
@@ -454,6 +454,15 @@ fn test_only_upstream_row_offsets_update_lifetime_segments_and_endpoints_without
});
assert_eq!(moved.rows[&birth].1, baseline.rows[&birth].1 + 60.);
assert_eq!(moved.rows[&death].1, baseline.rows[&death].1 + 60.);
for scene in [&baseline, &moved] {
assert_eq!(scene.activations.len(), 2);
for (call, reply) in [(c1, r1), (c2, r2)] {
assert!(scene.activations.iter().any(|segment| {
segment.call == call
&& segment.finish == Finish::Reply(reply)
}));
}
}
for (a, b) in baseline.activations.iter().zip(&moved.activations) {
assert_eq!(
(a.call, a.receiver, a.scope, a.column, a.finish),