aboutsummaryrefslogtreecommitdiff
path: root/test/syntax.ml
diff options
context:
space:
mode:
authorChimrod <>2023-10-29 11:05:47 +0100
committerChimrod <>2023-11-02 14:53:02 +0100
commita1bb96e73f54eaa7c7e4af5d930e9d10074afb08 (patch)
treeb51a0900a4220765c1cbefce3fb39ab57bd1ffaa /test/syntax.ml
parent77ae152ece4efbf8dde983c03bd995c982522bfd (diff)
Added tests for the nested literal mecanism
Diffstat (limited to 'test/syntax.ml')
-rw-r--r--test/syntax.ml18
1 files changed, 3 insertions, 15 deletions
diff --git a/test/syntax.ml b/test/syntax.ml
index 432ca8d..aabe2a8 100644
--- a/test/syntax.ml
+++ b/test/syntax.ml
@@ -790,6 +790,7 @@ let test_mutiple_inline_ifs () =
};
]
+(** The boolean comparaison has greater precedence than arithmetic operator *)
let test_precedence7 () =
_test_instruction "(1 + 1 = '')"
[
@@ -805,6 +806,7 @@ let test_precedence7 () =
Tree.Ast.Literal (_position, [ T.Text "" ]) ));
]
+(** The OR operator has greater precedence than boolean comparaison *)
let test_precedence8 () =
_test_instruction "(0 = 1 or 0 = 1)"
[
@@ -824,19 +826,6 @@ let test_precedence8 () =
Tree.Ast.Integer (_position, "1") ) ));
]
-let nested_string () =
- _test_instruction
- {|'<a href="exec: dynamic ''killvar''''$zapis'''',<<jur_temp>>">Delete</a>'|}
- [
- Tree.Ast.Expression
- (Tree.Ast.Literal
- ( _position,
- [
- T.Text
- {|<a href="exec: dynamic 'killvar''$zapis'',<<jur_temp>>">Delete</a>|};
- ] ));
- ]
-
(** Test showing the - should be considered as an operator and cannot be
aggregated inside the integer value. *)
let minus_operator () =
@@ -861,6 +850,7 @@ let test =
test_negative_numeric_expression;
Alcotest.test_case "-Numeric expression2" `Quick
test_negative_numeric_expression2;
+ Alcotest.test_case "Minus op" `Quick minus_operator;
Alcotest.test_case "$Variable expression" `Quick test_str_variable;
Alcotest.test_case " Variable expression" `Quick test_variable;
Alcotest.test_case "Indexed Variable expression" `Quick
@@ -915,6 +905,4 @@ let test =
Alcotest.test_case "inline if else if" `Quick test_mutiple_inline_ifs;
Alcotest.test_case "Precedence7" `Quick test_precedence7;
Alcotest.test_case "Precedence8" `Quick test_precedence8;
- Alcotest.test_case "Nested string" `Quick nested_string;
- Alcotest.test_case "Nested string" `Quick minus_operator;
] )