| 376 | |
| 377 | #[test] |
| 378 | fn dim_dict_dedups_repeated_values() { |
| 379 | let s = schema(); |
| 380 | let mut b = SparseTileBuilder::new(&s); |
| 381 | b.push( |
| 382 | &[CoordValue::Int64(1), CoordValue::Int64(100)], |
| 383 | &[CellValue::String("ALT".into()), CellValue::Float64(40.0)], |
| 384 | ) |
| 385 | .unwrap(); |
| 386 | b.push( |
| 387 | &[CoordValue::Int64(1), CoordValue::Int64(200)], |
| 388 | &[CellValue::String("REF".into()), CellValue::Float64(50.0)], |
| 389 | ) |
| 390 | .unwrap(); |
| 391 | let t = b.build(); |
| 392 | // chrom dictionary should have one entry (1 repeated). |
| 393 | assert_eq!(t.dim_dicts[0].cardinality(), 1); |
| 394 | assert_eq!(t.dim_dicts[0].len(), 2); |
| 395 | } |
| 396 | |
| 397 | #[test] |
| 398 | fn sparse_tile_rejects_bad_arity() { |