()
| 563 | |
| 564 | #[test] |
| 565 | fn test_extend() { |
| 566 | let mut builder = PrimitiveDictionaryBuilder::<Int32Type, Int32Type>::new(); |
| 567 | builder.extend([1, 2, 3, 1, 2, 3, 1, 2, 3].into_iter().map(Some)); |
| 568 | builder.extend([4, 5, 1, 3, 1].into_iter().map(Some)); |
| 569 | let dict = builder.finish(); |
| 570 | assert_eq!( |
| 571 | dict.keys().values(), |
| 572 | &[0, 1, 2, 0, 1, 2, 0, 1, 2, 3, 4, 0, 2, 0] |
| 573 | ); |
| 574 | assert_eq!(dict.values().len(), 5); |
| 575 | } |
| 576 | |
| 577 | #[test] |
| 578 | #[should_panic(expected = "DictionaryKeyOverflowError")] |