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

Function strict_load_errors_on_invalid_json

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

Source from the content-addressed store, hash-verified

2117
2118 #[test]
2119 fn strict_load_errors_on_invalid_json() {
2120 let dir = tmpdir();
2121 let path = dir.path().join("bad.json");
2122 fs::write(&path, "not json {{{").unwrap();
2123 let err = load_json_file_strict(&path).unwrap_err();
2124 let msg = err.to_string();
2125 assert!(msg.contains("cannot parse"), "error: {msg}");
2126 assert!(
2127 msg.contains("bad.json"),
2128 "error should mention filename: {msg}"
2129 );
2130 }
2131
2132 #[test]
2133 fn strict_load_errors_on_truncated_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