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

Function test_edit_json_roundtrip

atomic-core/src/change/graph_op.rs:881–892  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

879
880 #[test]
881 fn test_edit_json_roundtrip() {
882 let graph_op: GraphOp<Hash> = GraphOp::Edit {
883 change: Atom::Insertion(test_new_vertex()),
884 local: Local::new("src/lib.rs", 42),
885 encoding: Some(Encoding::Utf8),
886 };
887
888 let json = serde_json::to_string(&graph_op).unwrap();
889 let parsed: GraphOp<Hash> = serde_json::from_str(&json).unwrap();
890 assert_eq!(graph_op.path(), parsed.path());
891 assert_eq!(graph_op.line(), parsed.line());
892 }
893
894 #[test]
895 fn test_json_roundtrip_all_types() {

Callers

nothing calls this directly

Calls 3

InsertionClass · 0.85
test_new_vertexFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected