From 0f7d55c4bccbe49be8a538a36363078d40f1ef1f Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Wed, 29 Nov 2023 09:19:14 +0100 Subject: Added a test for the mod operator --- test/syntax.ml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') 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; -- cgit v1.2.3