mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-04 11:05:56 +00:00
Tests: a script keeps a fillet a parameter makes impossible, a radius below zero
ids_names_suppression_marker_and_failures_survive needs a feature that a parameter change makes fail, to see the failure survive the script's replay. It made a 1 mm round 50 mm, which truck refused as too big; SMLib builds a convex round wider than its faces by subtraction (the owner's overflow decision), so that round now succeeds. A radius of -1 mm fails on any kernel, and the replay still has to keep the failing feature, its id and its marker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -103,12 +103,13 @@ fn ids_names_suppression_marker_and_failures_survive() {
|
||||
run(&mut s, "parameters.add", json!({"name": "twice_depth", "expression": format!("{depth} * 2")}));
|
||||
run(&mut s, "parameters.comment", json!({"name": depth, "comment": "plate depth"}));
|
||||
run(&mut s, "parameters.favorite", json!({"name": depth}));
|
||||
// A fillet that a parameter change makes too big fails, and the design keeps it.
|
||||
// A fillet that a parameter change makes impossible (a radius below zero) fails, and the
|
||||
// design keeps it. (A convex round wider than its faces is built now, by subtraction.)
|
||||
run(&mut s, "parameters.add", json!({"name": "r", "expression": "1 mm"}));
|
||||
// Pick only the plate's edge, clear of the overlapping box's edge.
|
||||
run(&mut s, "solid.fillet", json!({"edges": [[20, 0, 10]], "radius": "r"}));
|
||||
let fillet = s.doc.features.last().unwrap().id;
|
||||
run(&mut s, "parameters.change", json!({"name": "r", "expression": "50 mm"}));
|
||||
run(&mut s, "parameters.change", json!({"name": "r", "expression": "-1 mm"}));
|
||||
assert!(s.model.result(fillet).and_then(|r| r.error.clone()).is_some(), "the fillet fails");
|
||||
run(&mut s, "timeline.rollback", json!({"position": 3}));
|
||||
let mut t = replay(&script(&mut s));
|
||||
|
||||
Reference in New Issue
Block a user