CoolFace
Datasetpublic

TheRealSamuel/LeetCodeProblem

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes564downloads
main.ml27 linesDownload Raw Back to ocaml_tests
1 2module Main = struct3    open OUnit24 5    (* Program start *)6 7    (* Program end *)8 9    (* Test cases *)10    11let test1 _ = assert_equal [50;20;80;15;17;19] (createBinaryTree [[20;15;1];[20;17;0];[50;20;1];[50;80;0];[80;19;1]])12 13let test2 _ = assert_equal [1;2;null;null;3;4] (createBinaryTree [[1;2;1];[2;3;0];[3;4;1]])14 15 16    (* Grouping test cases *)17    let suite = "Test Suite for createBinaryTree" >::: [18        19  "test1" >:: test1;20  "test2" >:: test2;21    ]22 23 24    (* Running the tests *)25    let () = run_test_tt_main suite26end27