diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/configuration/simple.toml | 4 | ||||
| -rw-r--r-- | tests/configuration_expression.ml | 19 | ||||
| -rw-r--r-- | tests/configuration_toml.ml | 4 | 
3 files changed, 23 insertions, 4 deletions
| diff --git a/tests/configuration/simple.toml b/tests/configuration/simple.toml index d41383a..9ca591a 100644 --- a/tests/configuration/simple.toml +++ b/tests/configuration/simple.toml @@ -8,13 +8,13 @@ tab = 1  [externals.target]  extern_key = "\"_B\""  # Here, the values A & B are considered as column, and not litteral -intern_key = "function(:A, :B)" +intern_key = "concat(:A, :B)"  allow_missing = true  file = ""  tab = 1  [sheet]  columns = [ -    "function(:target.A, :B, 'free\\' text')", +    "if(:target.A, :B, 'free\\' text')",      "counter([:target.A],[:target.A])"  ] 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 diff --git a/tests/configuration_toml.ml b/tests/configuration_toml.ml index e58ff1b..67f8d75 100644 --- a/tests/configuration_toml.ml +++ b/tests/configuration_toml.ml @@ -17,7 +17,7 @@ let test_suit =                  extern_key = Literal "_B";                  intern_key =                    Function -                    ( "function", +                    ( "concat",                        [                          Path { alias = None; column = 1 };                          Path { alias = None; column = 2 }; @@ -44,7 +44,7 @@ let test_suit =            let expected =              [                Function -                ( "function", +                ( "if",                    [                      Path { alias = Some "target"; column = 1 };                      Path { alias = None; column = 2 }; | 
