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

Function prepare_query_wrong_dim_fails

nodedb-vector/src/rerank/codecs/bbq.rs:331–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

329
330 #[test]
331 fn prepare_query_wrong_dim_fails() {
332 let codec = trained();
333 let bad = det_vec(0, DIM + 2);
334 match codec.prepare_query(&bad) {
335 Err(e) => {
336 let msg = format!("{e}");
337 assert!(
338 msg.contains("bad input") || msg.contains("dim"),
339 "expected bad input error, got: {msg}"
340 );
341 }
342 Ok(_) => panic!("expected an error for wrong dim"),
343 }
344 }
345
346 #[test]
347 fn distance_prepared_wrong_variant_fails() {

Callers

nothing calls this directly

Calls 3

trainedFunction · 0.70
det_vecFunction · 0.70
prepare_queryMethod · 0.45

Tested by

no test coverage detected