Skip to content

EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust

MCP: the auto-save recovery tests look for the JSON-quoted path

Jeremy Yao2a404f622679
diff --git a/apps/effectcraft-cli/tests/cli.rs b/apps/effectcraft-cli/tests/cli.rs
index 723016a86..51bdcc4ce 100644
--- a/apps/effectcraft-cli/tests/cli.rs
+++ b/apps/effectcraft-cli/tests/cli.rs
@@ -373,7 +373,9 @@ fn mcp_autosave_survives_kill_and_restart_without_touching_desktop_settings() {
assert_eq!(manifest["ended"], false);
let mut restarted = McpChild::start(&config, true);
let init = restarted.rpc("initialize", json!({}));
- assert!(init["instructions"].as_str().unwrap().contains(path));
+ // The instructions embed the auto-save info as JSON, so the path appears JSON-quoted (on
+ // Windows with its backslashes escaped).
+ assert!(init["instructions"].as_str().unwrap().contains(&json!(path).to_string()));
assert_eq!(init["_meta"]["effectcraftAutoSave"]["previousSessions"][0]["autosave"], path);
restarted.tool("open_project", json!({"path":path}));
let comp = restarted.tool("get_comp", json!({"comp":"Survives restart"}));
diff --git a/crates/automation/src/tests.rs b/crates/automation/src/tests.rs
index 44a61cc14..b4090ca7a 100644
--- a/crates/automation/src/tests.rs
+++ b/crates/automation/src/tests.rs
@@ -269,7 +269,9 @@ fn autosave_is_durable_before_reply_and_queries_do_not_rotate() {
drop(s); // Abrupt process loss has no EOF cleanup; the checkpoint already exists.
let mut restarted = server().with_autosave(&dir).unwrap();
let init = rpc(&mut restarted, 1, "initialize", json!({}));
- assert!(init["instructions"].as_str().unwrap().contains(path));
+ // The instructions embed the auto-save info as JSON, so the path appears JSON-quoted (on
+ // Windows with its backslashes escaped).
+ assert!(init["instructions"].as_str().unwrap().contains(&json!(path).to_string()));
assert_eq!(init["_meta"]["effectcraftAutoSave"]["previousSessions"][0]["autosave"], path);
call_json(&mut restarted, "open_project", json!({"path": path}));
assert_eq!(call_json(&mut restarted, "get_project", json!({}))["items"][0]["name"], "Durable");