aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChimrod <>2023-11-29 09:19:14 +0100
committerChimrod <>2023-11-29 09:19:14 +0100
commit0f7d55c4bccbe49be8a538a36363078d40f1ef1f (patch)
tree5553aab630cc2eac27adcee152f90119164063df /test
parent41e740cd35892eee77d645dca7c5caf3b4d23fed (diff)
Added a test for the mod operator
Diffstat (limited to 'test')
-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;