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

Function round_trip_empty_view

atomic-repository/src/manifest.rs:295–305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293 /// An empty view serializes its state as `-` and folds to ZERO.
294 #[test]
295 fn round_trip_empty_view() {
296 let m = ViewManifest::new("fresh", ViewScope::Shared, None, vec![]);
297 assert_eq!(m.state, Merkle::ZERO);
298
299 let text = m.to_text();
300 assert!(text.starts_with("fresh\tshared\t-\t-"));
301
302 let parsed = ViewManifest::parse(&text).unwrap();
303 assert_eq!(parsed, m);
304 parsed.verify().unwrap();
305 }
306
307 /// A declared state that doesn't match the log fails verification.
308 #[test]

Callers

nothing calls this directly

Calls 4

parseFunction · 0.85
to_textMethod · 0.80
unwrapMethod · 0.45
verifyMethod · 0.45

Tested by

no test coverage detected