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

Function test_edge_map_json_roundtrip

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

Source from the content-addressed store, hash-verified

759
760 #[test]
761 fn test_edge_map_json_roundtrip() {
762 let mut em = EdgeUpdate::<Hash>::new(test_hash_position(42));
763 em.push(NewEdge {
764 previous: EdgeFlags::BLOCK,
765 flag: EdgeFlags::BLOCK | EdgeFlags::DELETED,
766 from: test_hash_position(0),
767 to: GraphNode::new(
768 Hash::of(b"x"),
769 ChangePosition::new(0),
770 ChangePosition::new(5),
771 ),
772 introduced_by: Hash::of(b"intro"),
773 });
774
775 let json = serde_json::to_string(&em).unwrap();
776 let parsed: EdgeUpdate<Hash> = serde_json::from_str(&json).unwrap();
777 assert_eq!(em, parsed);
778 }
779
780 // NewEdge Tests
781

Callers

nothing calls this directly

Calls 3

test_hash_positionFunction · 0.70
pushMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected