MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_graph_traverse_json_works

Function parse_graph_traverse_json_works

nodedb-client/src/remote/parse.rs:106–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104
105 #[test]
106 fn parse_graph_traverse_json_works() {
107 let json = r#"{
108 "nodes": [{"id":"a","depth":0},{"id":"b","depth":1}],
109 "edges": [{"from":"a","to":"b","label":"KNOWS"}]
110 }"#;
111 let sg = parse_graph_traverse_json(json).unwrap();
112 assert_eq!(sg.node_count(), 2);
113 assert_eq!(sg.edge_count(), 1);
114 assert_eq!(sg.edges[0].label, "KNOWS");
115 }
116
117 #[test]
118 fn parse_empty_search_json() {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected