| 876 | |
| 877 | #[test] |
| 878 | fn test_map() { |
| 879 | let input = vec![ |
| 880 | // Note mix of short/long strings |
| 881 | Some("A"), |
| 882 | Some("bcdefghijklmnop"), |
| 883 | Some("X"), |
| 884 | Some("Y"), |
| 885 | None, |
| 886 | Some("qrstuvqxyzhjwya"), |
| 887 | Some("✨🔥"), |
| 888 | Some("🔥"), |
| 889 | Some("🔥🔥🔥🔥🔥🔥"), |
| 890 | ]; |
| 891 | |
| 892 | let mut test_map = TestMap::new(); |
| 893 | test_map.insert(&input); |
| 894 | test_map.insert(&input); // put it in twice |
| 895 | let expected_output: ArrayRef = Arc::new(StringArray::from(input)); |
| 896 | assert_eq!(&test_map.into_array(), &expected_output); |
| 897 | } |
| 898 | |
| 899 | #[derive(Debug, PartialEq, Eq, Default, Clone, Copy)] |
| 900 | struct TestPayload { |