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

Function test_json

cel/src/objects.rs:2196–2210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2194 #[test]
2195 #[cfg(feature = "json")]
2196 fn test_json() {
2197 let value = Arc::new(MyStruct {
2198 field: String::from("value"),
2199 });
2200 let cel_value = Value::Opaque(value);
2201 let mut map = serde_json::Map::new();
2202 map.insert(
2203 "field".to_string(),
2204 serde_json::Value::String("value".to_string()),
2205 );
2206 assert_eq!(
2207 cel_value.json().expect("Must convert"),
2208 serde_json::Value::Object(map)
2209 );
2210 }
2211
2212 #[test]
2213 fn test_optional() {

Callers

nothing calls this directly

Calls 2

OpaqueInterface · 0.85
StringClass · 0.85

Tested by

no test coverage detected