()
| 260 | |
| 261 | #[test] |
| 262 | fn checkpoint_roundtrip() { |
| 263 | let mut idx = SparseInvertedIndex::new(); |
| 264 | idx.insert("doc1", &make_sv(&[(10, 0.5), (20, 0.8)])); |
| 265 | idx.insert("doc2", &make_sv(&[(20, 0.3), (30, 1.0)])); |
| 266 | |
| 267 | let bytes = idx.checkpoint_to_bytes(); |
| 268 | let restored = SparseInvertedIndex::from_checkpoint(&bytes).unwrap(); |
| 269 | |
| 270 | assert_eq!(restored.doc_count(), 2); |
| 271 | assert_eq!(restored.dim_count(), 3); |
| 272 | assert!(restored.resolve_doc_id(0).is_some()); |
| 273 | } |
| 274 | |
| 275 | #[test] |
| 276 | fn multiple_docs_same_dim() { |
nothing calls this directly
no test coverage detected