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

Function parse_vector_search_json_works

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

Source from the content-addressed store, hash-verified

94
95 #[test]
96 fn parse_vector_search_json_works() {
97 let json = r#"[{"id":"v1","distance":0.1},{"id":"v2","distance":0.5}]"#;
98 let results = parse_vector_search_json(json).unwrap();
99 assert_eq!(results.len(), 2);
100 assert_eq!(results[0].id, "v1");
101 assert!((results[0].distance - 0.1).abs() < 0.001);
102 assert_eq!(results[1].id, "v2");
103 }
104
105 #[test]
106 fn parse_graph_traverse_json_works() {

Callers

nothing calls this directly

Calls 1

parse_vector_search_jsonFunction · 0.85

Tested by

no test coverage detected