CoolFace
Datasetpublic

TheRealSamuel/LeetCodeProblem

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes561downloads
main.ml51 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 true (hasMatch "leetcode" "ee*e")12 13let test2 _ = assert_equal false (hasMatch "car" "c*v")14 15let test3 _ = assert_equal true (hasMatch "luck" "u*")16 17let test4 _ = assert_equal false (hasMatch "fxdzelxekldposkfv" "w*x")18 19let test5 _ = assert_equal false (hasMatch "hvjtouuxcdldxairxhizqhurxfjnc" "xcphgkzmwxhok*mkkxewgmivyzcdtnvxlwmrgjyhhqytnmxz")20 21let test6 _ = assert_equal false (hasMatch "bki" "jagufqjls*qnqqre")22 23let test7 _ = assert_equal false (hasMatch "yyyupshqyzgsfa" "z*n")24 25let test8 _ = assert_equal false (hasMatch "riyqclmu" "mthvmft*ydlluorupgosnedafxlfxqksvtmnqnxbfirsub")26 27let test9 _ = assert_equal false (hasMatch "elmfffsslfjkpgnybbbsqnunjkismthskalvtinapewrgzdeh" "kmoossfovnjypcvooyoh*avtizoqnsjgnfotafvna")28 29let test10 _ = assert_equal false (hasMatch "bzaqnbowtpd" "fvpgxeaffhf*lw")30 31 32    (* Grouping test cases *)33    let suite = "Test Suite for hasMatch" >::: [34        35  "test1" >:: test1;36  "test2" >:: test2;37  "test3" >:: test3;38  "test4" >:: test4;39  "test5" >:: test5;40  "test6" >:: test6;41  "test7" >:: test7;42  "test8" >:: test8;43  "test9" >:: test9;44  "test10" >:: test10;45    ]46 47 48    (* Running the tests *)49    let () = run_test_tt_main suite50end51