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

Function test_has

cel/src/functions.rs:467–478  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

465
466 #[test]
467 fn test_has() {
468 let tests = vec![
469 ("map has", "has(foo.bar) == true"),
470 ("map not has", "has(foo.baz) == false"),
471 ];
472
473 for (name, script) in tests {
474 let mut ctx = Context::default();
475 ctx.add_variable_from_value("foo", std::collections::HashMap::from([("bar", 1)]));
476 assert_eq!(test_script(script, Some(ctx)), Ok(true.into()), "{name}");
477 }
478 }
479
480 #[test]
481 fn test_map() {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected