()
| 223 | |
| 224 | #[test] |
| 225 | fn insert_and_lookup() { |
| 226 | let mut idx = SparseInvertedIndex::new(); |
| 227 | let sv = make_sv(&[(10, 0.5), (20, 0.8)]); |
| 228 | idx.insert("doc1", &sv); |
| 229 | |
| 230 | assert_eq!(idx.doc_count(), 1); |
| 231 | assert_eq!(idx.dim_count(), 2); |
| 232 | |
| 233 | let postings = idx.get_postings(10).unwrap(); |
| 234 | assert_eq!(postings.len(), 1); |
| 235 | assert_eq!(postings[0].1, 0.5); |
| 236 | } |
| 237 | |
| 238 | #[test] |
| 239 | fn upsert_replaces() { |
nothing calls this directly
no test coverage detected