()
| 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() { |
nothing calls this directly
no test coverage detected