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
+18
View File
@@ -0,0 +1,18 @@
open Alcotest
open Syntax.Types
let test_pp_types () =
let to_check =
[
("Should return \"IntegerType\"", "IntegerType", IntegerType);
("Should return \"BooleanType\"", "BooleanType", BooleanType);
("Should return \"StringType\"", "StringType", StringType);
("Should return \"CharacterType\"", "CharacterType", CharacterType);
("Should return \"VoidType\"", "VoidType", VoidType);
]
in
List.iter
(fun (msg, expected, input) -> check string msg expected (pp_types input))
to_check
let tests = ("Types", [ test_case "pp_types" `Quick test_pp_types ])