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
+19
View File
@@ -0,0 +1,19 @@
open Alcotest
open Syntax.UnaryOperators
let test_pp_unary_operators () =
let to_check =
[
( "Should return \"ArithmeticNegation\"",
ArithmeticNegation,
"ArithmeticNegation" );
]
in
List.iter
(fun (msg, unary_operator, expected) ->
check string msg expected (pp_unary_operators unary_operator))
to_check
let tests =
( "UnaryOperators",
[ test_case "pp_unary_operators" `Quick test_pp_unary_operators ] )