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

Function test_new_edge_json_roundtrip

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

Source from the content-addressed store, hash-verified

884
885 #[test]
886 fn test_new_edge_json_roundtrip() {
887 let edge = NewEdge {
888 previous: EdgeFlags::BLOCK,
889 flag: EdgeFlags::BLOCK | EdgeFlags::DELETED,
890 from: test_hash_position(100),
891 to: GraphNode::new(
892 Hash::of(b"dest"),
893 ChangePosition::new(10),
894 ChangePosition::new(20),
895 ),
896 introduced_by: Hash::of(b"introduced"),
897 };
898
899 let json = serde_json::to_string(&edge).unwrap();
900 let parsed: NewEdge<Hash> = serde_json::from_str(&json).unwrap();
901 assert_eq!(edge, parsed);
902 }
903
904 #[test]
905 fn test_new_edge_postcard_roundtrip() {

Callers

nothing calls this directly

Calls 2

test_hash_positionFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected