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

Function assert_output

cel/src/lib.rs:252–258  ·  view source on GitHub ↗
(script: &str, expected: ResolveResult)

Source from the content-addressed store, hash-verified

250 #[test]
251 fn variables() {
252 fn assert_output(script: &str, expected: ResolveResult) {
253 let mut ctx = Context::default();
254 ctx.add_variable_from_value("foo", HashMap::from([("bar", 1i64)]));
255 ctx.add_variable_from_value("arr", vec![1i64, 2, 3]);
256 ctx.add_variable_from_value("str", "foobar".to_string());
257 assert_eq!(test_script(script, Some(ctx)), expected);
258 }
259
260 // Test methods
261 assert_output("size([1, 2, 3]) == 3", Ok(true.into()));

Callers 1

variablesFunction · 0.85

Calls 1

Tested by 1

variablesFunction · 0.68