()
| 1339 | /// own (no tracedecay plugin manifest), so it never nukes an unrelated dir. |
| 1340 | #[test] |
| 1341 | fn clean_replace_refuses_unmanaged_dir() { |
| 1342 | let tmp = TempDir::new().unwrap(); |
| 1343 | let install_dir = tmp.path().join("tracedecay"); |
| 1344 | std::fs::create_dir_all(&install_dir).unwrap(); |
| 1345 | std::fs::write(install_dir.join("user-file.txt"), "not tracedecay").unwrap(); |
| 1346 | |
| 1347 | let err = remove_cursor_plugin_install(&install_dir) |
| 1348 | .expect_err("must refuse an unmanaged directory"); |
| 1349 | assert!( |
| 1350 | err.to_string().contains("unmanaged"), |
| 1351 | "unexpected error: {err}" |
| 1352 | ); |
| 1353 | assert!( |
| 1354 | install_dir.join("user-file.txt").exists(), |
| 1355 | "an unmanaged dir must be left untouched" |
| 1356 | ); |
| 1357 | } |
| 1358 | |
| 1359 | /// The project-local legacy sweep must remove exactly the tracedecay-owned |
| 1360 | /// entries pre-plugin installs wrote (`mcp.json` server entry, |
nothing calls this directly
no test coverage detected