Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

test: failing regression test for #371 (ignored until fixed) (#379)

Jonas Wredeef9bb0db092d
diff --git a/crates/engine/src/cmd/sheet_tests.rs b/crates/engine/src/cmd/sheet_tests.rs
index a99ce69557..54d87cc0bb 100644
--- a/crates/engine/src/cmd/sheet_tests.rs
+++ b/crates/engine/src/cmd/sheet_tests.rs
@@ -1737,3 +1737,19 @@ fn fold_keeps_working_when_a_parameter_moves_the_sheet_off_its_fixed_point() {
assert!((bb["max"][0].as_f64().unwrap_or(0.0) - 80.0).abs() < 1e-6, "{bb}");
assert!(bb["max"][2].as_f64().unwrap_or(0.0) > 30.0, "{bb}");
}
+
+/// `fixed` 20 mm above a 2.5 mm sheet touches no material: refuse it or say so, like a point in a
+/// cut-out (#371).
+#[test]
+#[ignore = "fails until #371 is fixed"]
+fn fold_fixed_point_above_the_sheet_is_not_silently_accepted() {
+ let mut s = Session::default();
+ base(&mut s, 100.0, 60.0);
+ match s.execute("sheet.fold", &json!({"points": [[40, 0, 2.5], [40, 60, 2.5]], "fixed": [90, 30, 20]})) {
+ Err(e) => assert!(e.to_string().contains("fixed"), "{e}"),
+ Ok(r) => {
+ let warned = ["warning", "warnings"].iter().any(|k| r.get(*k).is_some_and(|w| w.to_string().contains("fixed")));
+ assert!(warned, "fixed [90, 30, 20] is 17.5 mm above the sheet, yet the fold succeeded silently: {r}");
+ }
+ }
+}