test: reproduce #271 (Command docs omit parameters that work: sheet.flange body_name, solid.loft targets)

This commit is contained in:
jonaswre authored and bherbruck committed 2026-10-12 10:07:10 -04:00
1 parent a9007d7b86
commit 879aacacf8
1 file changed
+17
+17
View File
@@ -2413,3 +2413,20 @@ fn special_files_are_refused_by_every_file_command() {
}
let _ = std::fs::remove_dir_all(&dir);
}
/// Parameters that work are listed in the command's params doc, which is all agents see (#271).
#[test]
fn params_docs_list_working_parameters() {
let mut s = Session::default();
let cmds = run(&mut s, "engine.commands", json!({}));
let params =
|id: &str| cmds.as_array().unwrap().iter().find(|c| c["id"] == id).and_then(|c| c["params"].as_str()).unwrap_or_default().to_string();
// Both work today: a named base flange, and a loft cut limited to its targets.
run(&mut s, "sketch.create", json!({"plane": "XY", "name": "A"}));
run(&mut s, "sketch.rectangle.two_point", json!({"p0": [0, 0], "p1": [50, 50]}));
run(&mut s, "sketch.finish", json!({}));
run(&mut s, "sheet.flange", json!({"sketch": "A", "body_name": "Panel A"}));
assert!(s.model.state().body("Panel A").is_some());
assert!(params("sheet.flange").contains("body_name"), "sheet.flange: {}", params("sheet.flange"));
assert!(params("solid.loft").contains("targets"), "solid.loft: {}", params("solid.loft"));
}