diff --git a/crates/kernel/src/record_tests.rs b/crates/kernel/src/record_tests.rs index 3590a7dca..31075a9a8 100644 --- a/crates/kernel/src/record_tests.rs +++ b/crates/kernel/src/record_tests.rs @@ -468,7 +468,8 @@ fn sweeps_along_paths() { check_sweep(&b, &side, &ring, Some(1)); } -/// Kept faces are their origins, unchanged; each edge an operand still owns is that edge. +/// Kept faces are their origins, unchanged; each edge an operand still owns is that edge (a new +/// edge, where two faces meet, has a Meet origin instead). fn check_kept(result: &Body, input: &Body) { let h = result.history().unwrap(); h.check(result, &[input]).unwrap(); @@ -482,7 +483,11 @@ fn check_kept(result: &Body, input: &Body) { let mut owned = 0; for (e, p) in re.iter().zip(&h.edges) { for o in &p.origins { - let crate::history::EdgeOrigin::Edge { operand: 0, edge } = o else { panic!("{o:?}") }; + let edge = match o { + crate::history::EdgeOrigin::Edge { operand: 0, edge } => edge, + crate::history::EdgeOrigin::Meet { .. } => continue, + _ => panic!("{o:?}"), + }; assert!(e.mid.dist(ie[*edge].mid) < 1e-6, "edge {}", e.index); owned += 1; } @@ -506,12 +511,14 @@ fn thicken_reports_copies_offsets_and_walls() { let h = t.history().unwrap(); assert_eq!(h.faces[0].origins, [FaceOrigin::Face { operand: 0, face: 0 }]); assert_eq!(h.faces[1].origins, [FaceOrigin::Offset { operand: 0, face: 0 }]); - let free: Vec = (0..half.edge_count()).collect(); + // A wall along each free edge of the sheet: the side's two rims, not its seam (an edge the + // one face meets itself along, no boundary). + let free: Vec = (0..half.edge_count()).filter(|e| half.record().edges[*e].uses.len() == 1).collect(); for (i, f) in h.faces.iter().enumerate().skip(2) { let [FaceOrigin::Edge { operand: 0, edge }] = f.origins.as_slice() else { panic!("{f:?}") }; assert_eq!(*edge, nearest_edge(&t, i, &half, &free)); } - assert_eq!(h.faces.len(), 2 + half.edge_count()); + assert_eq!(h.faces.len(), 2 + free.len()); } #[test]