From f2eb016e9824a9d8b1225ce5d6e3bc9a85ed096c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 20 Nov 2026 20:26:14 -0800 Subject: [PATCH] Tests: transform turns about the same pivot with a null or omitted origin transform_rejects_a_mistyped_reflect_copy_or_origin_before_editing ran a rotate with a null origin and checked only that the call succeeded. It now compares the resulting path with the same rotate with origin left out, so a null origin that moved the pivot would fail the test. --- crates/mcp/src/tests.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/mcp/src/tests.rs b/crates/mcp/src/tests.rs index 6a95469d92..c8756cefc7 100644 --- a/crates/mcp/src/tests.rs +++ b/crates/mcp/src/tests.rs @@ -1710,8 +1710,16 @@ fn transform_rejects_a_mistyped_reflect_copy_or_origin_before_editing() { assert_eq!(applied["isError"], false, "{applied}"); let applied: Value = serde_json::from_str(&text_of(&applied)).unwrap(); assert_eq!(applied["applied"], json!(["move"])); - let applied = call(&mut s, 21, "transform", json!({"ids": [second], "rotate": 90, "origin": null})); + let unturned = inspect(&mut s, 21)["layers"].clone(); + let applied = call(&mut s, 22, "transform", json!({"ids": [second], "rotate": 90, "origin": null})); assert_eq!(applied["isError"], false, "{applied}"); + let turned = inspect(&mut s, 23)["layers"].clone(); + assert_ne!(turned, unturned, "the rotation must change the path"); + // A null `origin` turns about the same default pivot as an omitted one. + assert_eq!(call(&mut s, 24, "undo", json!({}))["isError"], false); + let applied = call(&mut s, 25, "transform", json!({"ids": [second], "rotate": 90})); + assert_eq!(applied["isError"], false, "{applied}"); + assert_eq!(inspect(&mut s, 26)["layers"], turned); // The schema allows null for every argument but `ids`. let tools = tool_definitions(); let props = &tools.iter().find(|t| t["name"] == "transform").unwrap()["inputSchema"]["properties"];