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

Function strict_load_parses_valid_json

src/agents/mod.rs:2109–2116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2107
2108 #[test]
2109 fn strict_load_parses_valid_json() {
2110 let dir = tmpdir();
2111 let path = dir.path().join("valid.json");
2112 fs::write(&path, r#"{"hello": "world", "n": 42}"#).unwrap();
2113 let val = load_json_file_strict(&path).unwrap();
2114 assert_eq!(val["hello"], "world");
2115 assert_eq!(val["n"], 42);
2116 }
2117
2118 #[test]
2119 fn strict_load_errors_on_invalid_json() {

Callers

nothing calls this directly

Calls 3

tmpdirFunction · 0.85
writeFunction · 0.85
load_json_file_strictFunction · 0.85

Tested by

no test coverage detected