MCPcopy Index your code
hub / github.com/InfinitiBit/graphbit / test_vector_index_clear

Function test_vector_index_clear

core/src/memory/vector.rs:180–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178
179 #[tokio::test]
180 async fn test_vector_index_clear() {
181 let index = VectorIndex::new();
182 index.insert(MemoryId::new(), vec![1.0, 0.0]).await;
183 index.insert(MemoryId::new(), vec![0.0, 1.0]).await;
184
185 index.clear().await;
186
187 let results = index
188 .search(&[1.0, 0.0], 10, 0.0)
189 .await
190 .expect("search ok");
191 assert!(results.is_empty());
192 }
193}

Callers

nothing calls this directly

Calls 3

insertMethod · 0.80
clearMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected