| 1200 | |
| 1201 | #[test] |
| 1202 | fn test_maps() { |
| 1203 | // Test Map serialization |
| 1204 | let map = to_value(TestCompoundTypes::Map( |
| 1205 | HashMap::<String, &'static Bytes>::from_iter([( |
| 1206 | "Test".to_string(), |
| 1207 | Bytes::new(&[0_u8, 0_u8, 0_u8, 0_u8]), |
| 1208 | )]), |
| 1209 | )) |
| 1210 | .unwrap(); |
| 1211 | let expected: Value = HashMap::from([( |
| 1212 | "Map", |
| 1213 | HashMap::<Key, Value>::from_iter([( |
| 1214 | "Test".into(), |
| 1215 | Value::Bytes(Arc::new(vec![0_u8, 0_u8, 0_u8, 0_u8])), |
| 1216 | )]), |
| 1217 | )]) |
| 1218 | .into(); |
| 1219 | assert_eq!(map, expected) |
| 1220 | } |
| 1221 | |
| 1222 | #[cfg(feature = "chrono")] |
| 1223 | #[derive(Serialize)] |