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

Function test_edge_map_many_edges

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

Source from the content-addressed store, hash-verified

1005
1006 #[test]
1007 fn test_edge_map_many_edges() {
1008 let mut em = EdgeUpdate::<Hash>::new(test_hash_position(0));
1009
1010 for i in 0..100 {
1011 em.push(NewEdge {
1012 previous: EdgeFlags::BLOCK,
1013 flag: EdgeFlags::DELETED,
1014 from: test_hash_position(i),
1015 to: GraphNode::new(
1016 Hash::of(&[i as u8]),
1017 ChangePosition::new(0),
1018 ChangePosition::new(1),
1019 ),
1020 introduced_by: Hash::of(b"intro"),
1021 });
1022 }
1023
1024 assert_eq!(em.len(), 100);
1025
1026 // Verify serialization still works
1027 let bytes = postcard::to_allocvec(&em).unwrap();
1028 let parsed: EdgeUpdate<Hash> = postcard::from_bytes(&bytes).unwrap();
1029 assert_eq!(em, parsed);
1030 }
1031
1032 #[test]
1033 fn test_atom_to_option() {

Callers

nothing calls this directly

Calls 3

test_hash_positionFunction · 0.70
pushMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected