Report omitted print-face selections in command-script exports (#10230) (#10235)

* claim: #10230

* fix: report omitted print-face assignments in script exports
This commit is contained in:
Colin Faulkingham
2026-10-31 19:58:48 +00:00
committed by GitHub
parent 538d7fcb43
commit bba2fc1400
3 changed files with 60 additions and 1 deletions
+19
View File
@@ -170,6 +170,25 @@ fn what_the_script_leaves_out_is_listed_and_components_are_refused() {
assert!(e.contains("not supported yet"), "{e}");
}
#[test]
fn omitted_print_faces_are_reported_without_changing_the_design() {
let mut s = Session::default();
run(&mut s, "solid.box", json!({"length": 20, "width": 10, "height": 5, "body_name": "Block"}));
assert_eq!(run(&mut s, "timeline.export_script", json!({}))["omitted"], json!([]));
run(&mut s, "body.print_face", json!({"body": "Block", "point": [10, 5, 0]}));
let before = (*s.doc).clone();
let r = run(&mut s, "timeline.export_script", json!({}));
assert_eq!(r["omitted"], json!(["print-face assignments (body.print_face)"]));
assert_eq!(*s.doc, before, "export must keep the saved print-face assignment");
let mut t = replay(&r["script"]);
assert!(t.doc.print_faces.is_empty(), "the reported omission matches the replay");
same(&mut s, &mut t);
run(&mut s, "body.print_face", json!({"body": "Block"}));
assert_eq!(run(&mut s, "timeline.export_script", json!({}))["omitted"], json!([]));
}
#[test]
fn a_recorded_feature_that_does_not_fit_is_refused_and_changes_nothing() {
let mut s = Session::default();