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

Function test_size_fn_var

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

Source from the content-addressed store, hash-verified

1868
1869 #[test]
1870 fn test_size_fn_var() {
1871 let program = Program::compile("size(requests) + size == 5").unwrap();
1872 let mut context = Context::default();
1873 let requests = vec![Value::Int(42), Value::Int(42)];
1874 context
1875 .add_variable("requests", Value::List(Arc::new(requests)))
1876 .unwrap();
1877 context.add_variable("size", Value::Int(3)).unwrap();
1878 assert_eq!(program.execute(&context).unwrap(), Value::Bool(true));
1879 }
1880
1881 fn test_execution_error(program: &str, expected: ExecutionError) {
1882 let program = Program::compile(program).unwrap();

Callers

nothing calls this directly

Calls 2

IntClass · 0.85
add_variableMethod · 0.80

Tested by

no test coverage detected