mirror of
https://github.com/LucasVbr/croissant.git
synced 2026-05-14 01:22:06 +00:00
refactor: Syntax with unit tests
This commit is contained in:
@@ -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 ] )
|
||||
Reference in New Issue
Block a user