MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / test_safe_write_json_file

Function test_safe_write_json_file

tests/agent_suite/agent_test.rs:5438–5446  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5436
5437#[test]
5438fn test_safe_write_json_file() {
5439 let dir = TempDir::new().unwrap();
5440 let path = dir.path().join("output.json");
5441 let value = serde_json::json!({"hello": "world"});
5442 safe_write_json_file(&path, &value, None).unwrap();
5443 let content: serde_json::Value =
5444 serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();
5445 assert_eq!(content["hello"], "world");
5446}
5447
5448#[test]
5449fn test_safe_write_json_file_creates_parent_dirs() {

Callers

nothing calls this directly

Calls 1

safe_write_json_fileFunction · 0.85

Tested by

no test coverage detected