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

Function test_atom_json_roundtrip

atomic-core/src/change/atom.rs:926–940  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

924
925 #[test]
926 fn test_atom_json_roundtrip() {
927 let atom: Atom<Hash> = Atom::Insertion(Insertion {
928 predecessors: vec![],
929 successors: vec![],
930 flag: EdgeFlags::BLOCK,
931 start: ChangePosition::new(0),
932 end: ChangePosition::new(10),
933 inode: test_hash_position(0),
934 });
935
936 let json = serde_json::to_string(&atom).unwrap();
937 let parsed: Atom<Hash> = serde_json::from_str(&json).unwrap();
938 assert!(parsed.is_new_vertex());
939 assert_eq!(atom, parsed);
940 }
941
942 #[test]
943 fn test_atom_edge_map_json_roundtrip() {

Callers

nothing calls this directly

Calls 3

InsertionClass · 0.85
test_hash_positionFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected