()
| 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(); |
nothing calls this directly
no test coverage detected