Face capture test: extruding a split face in an uncaptured component is refused

The refusal "capture the source occurrence position before generating a
legacy face profile across components" lost its test when Offset Face got
an exact history name (b6c3bf3c5). A half of a box's top that Split Face
divided still has neither a construction certificate nor an exact history
name, so Extrude from that face, in a component whose occurrence has an
uncaptured move, takes the legacy path and is refused there; the document
and the pending moves stay as they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jyviko
2026-10-30 00:35:26 -04:00
committed by Irakli Kourtis
parent a84369fe71
commit 73b0532212
+21
View File
@@ -184,6 +184,27 @@ fn internal_capture_in_another_component_anchors_an_offset_face_by_its_history_n
assert_eq!(s.pending_moves, pending);
}
/// Extrude from a face in another component whose occurrence has an uncaptured move, where the
/// face has neither a construction certificate nor an exact history name: a half of a box's top
/// that Split Face divided. The face profile would take the legacy path, which can't capture the
/// source's pending position, so the extrude is refused and changes nothing.
#[test]
fn face_extrude_of_a_split_face_in_another_component_refuses_an_uncaptured_source() {
let mut s = Session::default();
let component = run(&mut s, "component.create", json!({"name":"Source","grounded":false}));
let occurrence = component["occurrence"].as_u64().unwrap();
run(&mut s, "solid.box", json!({"length":40,"width":30,"height":20,"body_name":"Stock"}));
run(&mut s, "solid.split_face", json!({"faces":[[10,15,20]],"plane":{"origin":[20,0,0],"normal":[1,0,0]}}));
run(&mut s, "component.activate", json!({"component":0}));
run(&mut s, "occurrence.move", json!({"occurrence":occurrence,"translate":[30,0,0],"capture":false}));
let before = s.doc.to_json();
let pending = s.pending_moves.clone();
let error = s.execute("solid.extrude", &json!({"face":[40,15,20],"distance":5,"operation":"new"})).unwrap_err();
assert!(error.to_string().contains("capture the source occurrence position"), "{error}");
assert_eq!(s.doc.to_json(), before);
assert_eq!(s.pending_moves, pending);
}
#[test]
fn repeated_source_face_profile_requires_and_uses_the_exact_active_occurrence() {
let mut s = Session::default();