()
| 297 | |
| 298 | #[test] |
| 299 | fn test_tree_map_serialization() { |
| 300 | let (dim_bufman, data_bufmans, _cursor, temp_dir) = setup_test(); |
| 301 | let mut rng = rand::thread_rng(); |
| 302 | let map = TreeMap::new(dim_bufman, data_bufmans); |
| 303 | |
| 304 | for i in 0..1000 { |
| 305 | map.insert(0.into(), &i, rng.gen_range(0..u16::MAX)); |
| 306 | } |
| 307 | |
| 308 | // edge case |
| 309 | map.insert(0.into(), &u64::MAX, rng.gen_range(0..u16::MAX)); |
| 310 | |
| 311 | map.serialize().unwrap(); |
| 312 | |
| 313 | let (dim_bufman, data_bufmans) = setup_test_in_dir(temp_dir.as_ref()); |
| 314 | |
| 315 | let deserialized = TreeMap::<u64, u16>::deserialize(dim_bufman, data_bufmans).unwrap(); |
| 316 | |
| 317 | assert_eq!(map, deserialized); |
| 318 | } |
| 319 | |
| 320 | #[test] |
| 321 | fn test_tree_map_vec_serialization() { |
nothing calls this directly
no test coverage detected