CoolFace
Datasetpublic

FPEvalDataset/LeetCodeProblem

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes304downloads
main.ml46 linesDownload Raw Back to ocaml_tests
1 2module Main = struct3    open OUnit24 5    (* Program start *)6    let removeAlmostEqualCharacters (word: string) : int =   failwith "Not implemented"7 8    (* Program end *)9 10    (* Test cases *)11    12let test1 _ = assert_equal 2 (removeAlmostEqualCharacters "aaaaa")13 14let test2 _ = assert_equal 2 (removeAlmostEqualCharacters "abddez")15 16let test3 _ = assert_equal 3 (removeAlmostEqualCharacters "zyxyxyz")17 18let test4 _ = assert_equal 3 (removeAlmostEqualCharacters "egemspqbudprialxwsqfsbfebuuelyvzymevldlviaesalwhpaepxgxsspnmogegnozjintuq")19 20let test5 _ = assert_equal 3 (removeAlmostEqualCharacters "pgp")21 22let test6 _ = assert_equal 3 (removeAlmostEqualCharacters "nyblzqabcwjcyuzezzlzxshqqpecfekiugft")23 24let test7 _ = assert_equal 3 (removeAlmostEqualCharacters "omnbzkruaz")25 26let test8 _ = assert_equal 3 (removeAlmostEqualCharacters "mbrfpgvglbadahkokomrsydnbvoueolbawkteoxpxvaxdxgudiuvtlqgisiiptatjdkcsdsfntgvgq")27 28 29    (* Grouping test cases *)30    let suite = "Test Suite for removeAlmostEqualCharacters" >::: [31        32  "test1" >:: test1;33  "test2" >:: test2;34  "test3" >:: test3;35  "test4" >:: test4;36  "test5" >:: test5;37  "test6" >:: test6;38  "test7" >:: test7;39  "test8" >:: test8;40    ]41 42 43    (* Running the tests *)44    let () = run_test_tt_main suite45end46