MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / fixture

Function fixture

atomic-canonical/tests/jcs_vectors.rs:24–28  ·  view source on GitHub ↗
(name: &str)

Source from the content-addressed store, hash-verified

22}
23
24fn fixture(name: &str) -> Value {
25 let path = vector_dir().join(format!("{name}.json"));
26 let raw = fs::read_to_string(&path).unwrap_or_else(|e| panic!("read {path:?}: {e}"));
27 serde_json::from_str(&raw).unwrap_or_else(|e| panic!("parse {path:?}: {e}"))
28}
29
30/// Parse the fixture's input the way any caller receiving JSON does, canonicalize
31/// it, and require the exact bytes.

Callers 2

assert_canonicalFunction · 0.70

Calls 1

vector_dirFunction · 0.85

Tested by

no test coverage detected