()
| 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 |
nothing calls this directly
no test coverage detected