CoolFace
Datasetpublic

FPEvalDataset/LeetCodeProblem

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes304downloads
main.ml30 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 [-1;-2;-2] (getSubarrayBeauty [1;-1;-3;-2;3] 3 2)12 13let test2 _ = assert_equal [-1;-2;-3;-4] (getSubarrayBeauty [-1;-2;-3;-4;-5] 2 2)14 15let test3 _ = assert_equal [-3;0;-3;-3;-3] (getSubarrayBeauty [-3;1;2;-3;0;-3] 2 1)16 17 18    (* Grouping test cases *)19    let suite = "Test Suite for getSubarrayBeauty" >::: [20        21  "test1" >:: test1;22  "test2" >:: test2;23  "test3" >:: test3;24    ]25 26 27    (* Running the tests *)28    let () = run_test_tt_main suite29end30