CoolFace
Datasetpublic

FPEvalDataset/LeetCodeProblem

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes304downloads
Main.hs42 linesDownload Raw Back to haskell_tests
1 2module Main where3import Test.HUnit4 5--Program start6constructProductMatrix :: [[Int]] -> [[Int]]7constructProductMatrix grid = undefined8 9--Program end10 11-- Test cases12 13test1 :: Test14test1 = TestCase (assertEqual "for (constructProductMatrix [[1,2],[3,4]])," [[24,12],[8,6]] (constructProductMatrix [[1,2],[3,4]]))15 16test2 :: Test17test2 = TestCase (assertEqual "for (constructProductMatrix [[12345],[2],[1]])," [[2],[0],[0]] (constructProductMatrix [[12345],[2],[1]]))18 19test3 :: Test20test3 = TestCase (assertEqual "for (constructProductMatrix [[12075, 12075, 7245, 2145, 10350, 11805, 11535], [11940, 12165, 2145, 10725, 11535, 2145, 11535], [10350, 10350, 11535, 5970, 11940, 10350, 7245]])," [[12075,12075,7245,2145,10350,11805,11535],[11940,12165,2145,10725,11535,2145,11535],[10350,10350,11535,5970,11940,10350,7245]] (constructProductMatrix [[12075, 12075, 7245, 2145, 10350, 11805, 11535], [11940, 12165, 2145, 10725, 11535, 2145, 11535], [10350, 10350, 11535, 5970, 11940, 10350, 7245]]))21 22test4 :: Test23test4 = TestCase (assertEqual "for (constructProductMatrix [[60, 120, 9975, 2550, 240], [9375, 8535, 1680, 11460, 10650], [4305, 9975, 240, 8265, 825], [5448, 3360, 1335, 4440, 8790]])," [[60,120,9975,2550,240],[9375,8535,1680,11460,10650],[4305,9975,240,8265,825],[5448,3360,1335,4440,8790]] (constructProductMatrix [[60, 120, 9975, 2550, 240], [9375, 8535, 1680, 11460, 10650], [4305, 9975, 240, 8265, 825], [5448, 3360, 1335, 4440, 8790]]))24 25test5 :: Test26test5 = TestCase (assertEqual "for (constructProductMatrix [[6705], [4794], [3855], [12270], [3240], [11550], [6750], [4755], [11250]])," [[6705],[4794],[3855],[12270],[3240],[11550],[6750],[4755],[11250]] (constructProductMatrix [[6705], [4794], [3855], [12270], [3240], [11550], [6750], [4755], [11250]]))27 28test6 :: Test29test6 = TestCase (assertEqual "for (constructProductMatrix [[9285], [2235], [4700], [3375], [9615], [3600]])," [[9285],[2235],[4700],[3375],[9615],[3600]] (constructProductMatrix [[9285], [2235], [4700], [3375], [9615], [3600]]))30 31test7 :: Test32test7 = TestCase (assertEqual "for (constructProductMatrix [[9780, 9345, 11940, 5865, 6480], [7320, 11640, 9240, 1080, 4410], [30, 3435, 12075, 10755, 150], [1215, 8415, 7410, 8925, 12225], [8340, 4500, 4785, 768, 855]])," [[9780,9345,11940,5865,6480],[7320,11640,9240,1080,4410],[30,3435,12075,10755,150],[1215,8415,7410,8925,12225],[8340,4500,4785,768,855]] (constructProductMatrix [[9780, 9345, 11940, 5865, 6480], [7320, 11640, 9240, 1080, 4410], [30, 3435, 12075, 10755, 150], [1215, 8415, 7410, 8925, 12225], [8340, 4500, 4785, 768, 855]]))33 34 35-- Grouping test cases36tests :: Test37tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2, TestLabel "Test3" test3, TestLabel "Test4" test4, TestLabel "Test5" test5, TestLabel "Test6" test6]38 39-- Running the tests40main :: IO Counts41main = runTestTT tests42