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

Function insert_and_search

nodedb-vector/src/collection/search.rs:461–470  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

459
460 #[test]
461 fn insert_and_search() {
462 let mut coll = make_collection();
463 for i in 0..100u32 {
464 coll.insert(vec![i as f32, 0.0, 0.0]);
465 }
466 assert_eq!(coll.len(), 100);
467 let results = coll.search(&[50.0, 0.0, 0.0], 3, 64);
468 assert_eq!(results.len(), 3);
469 assert_eq!(results[0].id, 50);
470 }
471
472 #[test]
473 fn seal_moves_to_building() {

Callers

nothing calls this directly

Calls 3

make_collectionFunction · 0.70
insertMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected