CoolFace
Datasetpublic

TheRealSamuel/LeetCodeProblem

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes564downloads
Main.hs45 linesDownload Raw Back to haskell_tests
1 2module Main where3import Test.HUnit4 5--Program start6removeAlmostEqualCharacters :: String -> Int7removeAlmostEqualCharacters word = undefined8 9--Program end10 11-- Test cases12 13test1 :: Test14test1 = TestCase (assertEqual "for (removeAlmostEqualCharacters \"aaaaa \")," 2 (removeAlmostEqualCharacters "aaaaa"))15 16test2 :: Test17test2 = TestCase (assertEqual "for (removeAlmostEqualCharacters \"abddez \")," 2 (removeAlmostEqualCharacters "abddez"))18 19test3 :: Test20test3 = TestCase (assertEqual "for (removeAlmostEqualCharacters \"zyxyxyz \")," 3 (removeAlmostEqualCharacters "zyxyxyz"))21 22test4 :: Test23test4 = TestCase (assertEqual "for (removeAlmostEqualCharacters  \"egemspqbudprialxwsqfsbfebuuelyvzymevldlviaesalwhpaepxgxsspnmogegnozjintuq \")," 10 (removeAlmostEqualCharacters "egemspqbudprialxwsqfsbfebuuelyvzymevldlviaesalwhpaepxgxsspnmogegnozjintuq"))24 25test5 :: Test26test5 = TestCase (assertEqual "for (removeAlmostEqualCharacters  \"pgp \")," 0 (removeAlmostEqualCharacters "pgp"))27 28test6 :: Test29test6 = TestCase (assertEqual "for (removeAlmostEqualCharacters  \"nyblzqabcwjcyuzezzlzxshqqpecfekiugft \")," 5 (removeAlmostEqualCharacters "nyblzqabcwjcyuzezzlzxshqqpecfekiugft"))30 31test7 :: Test32test7 = TestCase (assertEqual "for (removeAlmostEqualCharacters  \"omnbzkruaz \")," 1 (removeAlmostEqualCharacters "omnbzkruaz"))33 34test8 :: Test35test8 = TestCase (assertEqual "for (removeAlmostEqualCharacters  \"mbrfpgvglbadahkokomrsydnbvoueolbawkteoxpxvaxdxgudiuvtlqgisiiptatjdkcsdsfntgvgq \")," 5 (removeAlmostEqualCharacters "mbrfpgvglbadahkokomrsydnbvoueolbawkteoxpxvaxdxgudiuvtlqgisiiptatjdkcsdsfntgvgq"))36 37 38-- Grouping test cases39tests :: Test40tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2, TestLabel "Test3" test3, TestLabel "Test4" test4, TestLabel "Test5" test5, TestLabel "Test6" test6, TestLabel "Test7" test7]41 42-- Running the tests43main :: IO Counts44main = runTestTT tests45