()
| 310 | |
| 311 | #[test] |
| 312 | fn sidecar_roundtrip_binary() { |
| 313 | use crate::rerank::codecs::BinaryRerank; |
| 314 | let dim = 16; |
| 315 | let mut s = CodecSidecar::new(Arc::new(BinaryRerank::new(dim))); |
| 316 | for i in 0..5u32 { |
| 317 | s.encode_and_insert(i, &det_vec(i as usize, dim)).unwrap(); |
| 318 | } |
| 319 | let bytes = s.to_bytes().expect("to_bytes"); |
| 320 | let s2 = CodecSidecar::from_bytes(&bytes).expect("from_bytes"); |
| 321 | assert_eq!(s2.codec_name(), CodecName::Binary); |
| 322 | for i in 0..5u32 { |
| 323 | assert_eq!(s.get(i), s2.get(i), "encoded bytes differ for id {i}"); |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | #[test] |
| 328 | fn sidecar_roundtrip_pq() { |
nothing calls this directly
no test coverage detected