MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / test_maps

Function test_maps

cel/src/ser.rs:1202–1220  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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)]

Callers

nothing calls this directly

Calls 3

to_valueFunction · 0.85
MapClass · 0.85
BytesClass · 0.85

Tested by

no test coverage detected