refactor: Syntax with unit tests

This commit is contained in:
Lucàs
2024-07-08 16:44:42 +02:00
parent 6df363c78d
commit 2e76ccf9fc
39 changed files with 460 additions and 771 deletions
+20
View File
@@ -0,0 +1,20 @@
open Alcotest
open Syntax.BinaryOperators
let test_pp_binary_operators () =
let to_check =
[
("Should return \"Add\"", "Add", Add);
("Should return \"Subtract\"", "Subtract", Subtract);
("Should return \"Multiply\"", "Multiply", Multiply);
("Should return \"Divide\"", "Divide", Divide);
]
in
List.iter
(fun (msg, expected, actual) ->
check string msg expected (pp_binary_operators actual))
to_check
let tests =
( "BinaryOperators",
[ test_case "pp_binary_operators" `Quick test_pp_binary_operators ] )