test: failing regression test for #267: timeline.delete of a sketch leaves later features that use its body by name (#282)
* test: reproduce #267 (timeline.delete of a sketch leaves later features that use its body by name) * fix: timeline.delete reports features that newly fail (#267) A later feature that names a deleted body (a combine targeting a deleted extrude's body) is listed under failing: [{feature, error}] in the reply instead of failing silently. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT --------- Co-authored-by: bherbruck <brennen.herbruck@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2 files changed
+37
-2
No files matched your search
@@ -2489,6 +2489,27 @@ fn special_files_are_refused_by_every_file_command() {
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// Deleting a sketch takes its extrude with it; a later combine that names the extrude's body must
|
||||
/// not be left failing silently: it is deleted too, or the reply reports it (#267).
|
||||
#[test]
|
||||
fn deleting_a_sketch_leaves_no_silently_failing_feature() {
|
||||
let mut s = Session::default();
|
||||
run(&mut s, "sketch.create", json!({"plane": "XY", "name": "S"}));
|
||||
run(&mut s, "sketch.rectangle.two_point", json!({"p0": [0, 0], "p1": [20, 20]}));
|
||||
run(&mut s, "sketch.finish", json!({}));
|
||||
run(&mut s, "solid.extrude", json!({"sketch": "S", "distance": "10", "body_name": "P"}));
|
||||
run(&mut s, "solid.box", json!({"length": 5, "width": 5, "height": 5, "corner": [18, 5, 0], "operation": "new_body", "body_name": "Q"}));
|
||||
run(&mut s, "solid.combine", json!({"target": "P", "tools": ["Q"], "name": "JoinPQ"}));
|
||||
let reply = run(&mut s, "timeline.delete", json!({"features": ["S"]}));
|
||||
if let Ok(join) = s.execute("timeline.inspect", &json!({"feature": "JoinPQ"})) {
|
||||
assert!(
|
||||
join["error"].is_null() || reply.to_string().contains("JoinPQ"),
|
||||
"JoinPQ now fails ({}) but the reply only says {reply}",
|
||||
join["error"]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Every body a multi-profile `new` extrude creates carries its `body_name`, not a generic BodyN (#266).
|
||||
#[test]
|
||||
fn multi_profile_extrude_names_every_body_after_body_name() {
|
||||
|
||||
Reference in new issue
Block a user