From ef9bb0db092d11d1bb0836eb067c91b6a64d3e03 Mon Sep 17 00:00:00 2001 From: Jonas Wrede Date: Mon, 12 Oct 2026 21:34:41 +0200 Subject: [PATCH] test: failing regression test for #371 (ignored until fixed) (#379) Co-authored-by: bherbruck --- crates/engine/src/cmd/sheet_tests.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/engine/src/cmd/sheet_tests.rs b/crates/engine/src/cmd/sheet_tests.rs index a99ce695..54d87cc0 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}"); + } + } +}