aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/syntax.ml12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/syntax.ml b/test/syntax.ml
index aabe2a8..e81bf3d 100644
--- a/test/syntax.ml
+++ b/test/syntax.ml
@@ -313,6 +313,17 @@ $firstName + ' ' + $lastName
{ Tree.Ast.pos = _position; name = "$LASTNAME"; index = None } ));
]
+let test_mod () =
+ _test_instruction {|2 mod 1|}
+ [
+ Tree.Ast.Expression
+ (Tree.Ast.BinaryOp
+ ( _position,
+ T.Mod,
+ Tree.Ast.Integer (_position, "2"),
+ Tree.Ast.Integer (_position, "1") ));
+ ]
+
let test_comment () = _test_instruction "! Comment" [ Comment _position ]
let test_comment2 () =
@@ -871,6 +882,7 @@ let test =
Alcotest.test_case "Plus" `Quick test_plus;
Alcotest.test_case "Plus_litt" `Quick test_plus_litt;
Alcotest.test_case "PlusChained" `Quick test_concat;
+ Alcotest.test_case "Mod operator" `Quick test_mod;
Alcotest.test_case "Comment" `Quick test_comment;
Alcotest.test_case "Comment2" `Quick test_comment2;
Alcotest.test_case "Comment3" `Quick test_comment3;