From 986bcb796d8b9e1f485baa8da599aa816c56b587 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 7 Jan 2025 22:40:19 +0100 Subject: Explicitly list all the availables functions --- tests/configuration_expression.ml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/configuration_expression.ml') 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 -- cgit v1.2.3