diff options
Diffstat (limited to 'tests/configuration_expression.ml')
-rw-r--r-- | tests/configuration_expression.ml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/configuration_expression.ml b/tests/configuration_expression.ml index a5c4755..fc4c0ec 100644 --- a/tests/configuration_expression.ml +++ b/tests/configuration_expression.ml @@ -224,6 +224,23 @@ let priority_operator_or = (Or, BOperator (Different, Integer "1", Integer "1"), Integer "0"))) result +let unknown_function = + "unknown function" >:: fun _ -> + let expr = "function()" in + let result = ImportConf.expression_from_string expr in + + assert_equal ~printer + (Error "Unknown function or wrong number of arguments for 'function'") + result + +let wrong_arguments = + "unknown function" >:: fun _ -> + let expr = "if()" in + let result = ImportConf.expression_from_string expr in + + assert_equal ~printer + (Error "Unknown function or wrong number of arguments for 'if'") result + let test_suit = [ parse_dquoted; @@ -248,6 +265,8 @@ let test_suit = priority_equality; priority_operator_and; priority_operator_or; + unknown_function; + wrong_arguments; ] let tests = "configuration_expression" >::: test_suit |