CoolFace
Datasetpublic

FPEvalDataset/LeetCodeProblem

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes304downloads
Main.hs46 linesDownload Raw Back to haskell_tests
1 2module Main where3import Test.HUnit4 5--Program start6 7--Program end8 9-- Test cases10 11test1 :: Test12test1 = TestCase (assertEqual "for (maximumValueSum [1,2,1] 3 [[0,1],[0,2]])," 6 (maximumValueSum [1,2,1] 3 [[0,1],[0,2]]))13 14test2 :: Test15test2 = TestCase (assertEqual "for (maximumValueSum [2,3] 7 [[0,1]])," 9 (maximumValueSum [2,3] 7 [[0,1]]))16 17test3 :: Test18test3 = TestCase (assertEqual "for (maximumValueSum [7,7,7,7,7,7] 3 [[0,1],[0,2],[0,3],[0,4],[0,5]])," 42 (maximumValueSum [7,7,7,7,7,7] 3 [[0,1],[0,2],[0,3],[0,4],[0,5]]))19 20test4 :: Test21test4 = TestCase (assertEqual "for (maximumValueSum [977538041, 914985843, 221838576, 501483518, 488047899, 707773864, 824502743, 115109856, 140156554, 10586824, 50988438, 577753314, 285640935, 817005225, 299414865, 884300312, 659005571, 683658123] 220908190 [[0, 1], [1, 2], [2, 3], [1, 4], [4, 5], [5, 6], [3, 7], [1, 8], [8, 9], [1, 10], [10, 11], [7, 12], [8, 13], [7, 14], [11, 15], [11, 16], [10, 17]])," 10809396445 (maximumValueSum [977538041, 914985843, 221838576, 501483518, 488047899, 707773864, 824502743, 115109856, 140156554, 10586824, 50988438, 577753314, 285640935, 817005225, 299414865, 884300312, 659005571, 683658123] 220908190 [[0, 1], [1, 2], [2, 3], [1, 4], [4, 5], [5, 6], [3, 7], [1, 8], [8, 9], [1, 10], [10, 11], [7, 12], [8, 13], [7, 14], [11, 15], [11, 16], [10, 17]]))22 23test5 :: Test24test5 = TestCase (assertEqual "for (maximumValueSum [949981876, 11477663, 618727282, 869248515, 954828286, 963523325, 746318200, 14800663, 364276796, 12281068, 398856652, 421492724, 555042350, 87423989, 10573301, 636578468, 292942321, 225186788] 763265655 [[0, 1], [0, 2], [2, 3], [2, 4], [2, 5], [2, 6], [2, 7], [3, 8], [4, 9], [2, 10], [5, 11], [9, 12], [9, 13], [5, 14], [2, 15], [1, 16], [14, 17]])," 14404175351 (maximumValueSum [949981876, 11477663, 618727282, 869248515, 954828286, 963523325, 746318200, 14800663, 364276796, 12281068, 398856652, 421492724, 555042350, 87423989, 10573301, 636578468, 292942321, 225186788] 763265655 [[0, 1], [0, 2], [2, 3], [2, 4], [2, 5], [2, 6], [2, 7], [3, 8], [4, 9], [2, 10], [5, 11], [9, 12], [9, 13], [5, 14], [2, 15], [1, 16], [14, 17]]))25 26test6 :: Test27test6 = TestCase (assertEqual "for (maximumValueSum [745311166, 850593829, 117376415, 112862397, 220549307, 911445538, 834876316, 849475440, 81818436, 406272938, 128674880, 833156998, 214081401, 606693707, 796952554, 274223460, 426632282, 314538858, 518198322, 575086589] 968161642 [[0, 1], [0, 2], [2, 3], [2, 4], [2, 5], [4, 6], [4, 7], [5, 8], [1, 9], [8, 10], [2, 11], [6, 12], [10, 13], [7, 14], [4, 15], [6, 16], [7, 17], [0, 18], [0, 19]])," 16066485697 (maximumValueSum [745311166, 850593829, 117376415, 112862397, 220549307, 911445538, 834876316, 849475440, 81818436, 406272938, 128674880, 833156998, 214081401, 606693707, 796952554, 274223460, 426632282, 314538858, 518198322, 575086589] 968161642 [[0, 1], [0, 2], [2, 3], [2, 4], [2, 5], [4, 6], [4, 7], [5, 8], [1, 9], [8, 10], [2, 11], [6, 12], [10, 13], [7, 14], [4, 15], [6, 16], [7, 17], [0, 18], [0, 19]]))28 29test7 :: Test30test7 = TestCase (assertEqual "for (maximumValueSum [44291611, 386215946, 375861387, 504839330, 84457102, 951788380, 827948560, 246022760] 310790086 [[0, 1], [1, 2], [1, 3], [3, 4], [0, 5], [4, 6], [4, 7]])," 3959341884 (maximumValueSum [44291611, 386215946, 375861387, 504839330, 84457102, 951788380, 827948560, 246022760] 310790086 [[0, 1], [1, 2], [1, 3], [3, 4], [0, 5], [4, 6], [4, 7]]))31 32test8 :: Test33test8 = TestCase (assertEqual "for (maximumValueSum [391658618, 10284122, 964167617, 293237510, 906154707, 888486155, 390244058, 246905744, 453161757, 289165279, 993194070, 458759549, 870761519] 91858911 [[0, 1], [0, 2], [1, 3], [0, 4], [0, 5], [0, 6], [0, 7], [6, 8], [5, 9], [9, 10], [6, 11], [3, 12]])," 7583473179 (maximumValueSum [391658618, 10284122, 964167617, 293237510, 906154707, 888486155, 390244058, 246905744, 453161757, 289165279, 993194070, 458759549, 870761519] 91858911 [[0, 1], [0, 2], [1, 3], [0, 4], [0, 5], [0, 6], [0, 7], [6, 8], [5, 9], [9, 10], [6, 11], [3, 12]]))34 35test9 :: Test36test9 = TestCase (assertEqual "for (maximumValueSum [53742462, 631248016, 157640466, 540450446, 197211472, 908831573, 636352024, 681393970, 968786857, 802549093, 344688510, 537896129, 227515237, 662975492, 951612635, 253708898, 187242418, 354643418, 814465367] 388231932 [[0, 1], [1, 2], [0, 3], [2, 4], [1, 5], [4, 6], [3, 7], [2, 8], [4, 9], [1, 10], [6, 11], [7, 12], [9, 13], [12, 14], [0, 15], [11, 16], [15, 17], [17, 18]])," 13239291355 (maximumValueSum [53742462, 631248016, 157640466, 540450446, 197211472, 908831573, 636352024, 681393970, 968786857, 802549093, 344688510, 537896129, 227515237, 662975492, 951612635, 253708898, 187242418, 354643418, 814465367] 388231932 [[0, 1], [1, 2], [0, 3], [2, 4], [1, 5], [4, 6], [3, 7], [2, 8], [4, 9], [1, 10], [6, 11], [7, 12], [9, 13], [12, 14], [0, 15], [11, 16], [15, 17], [17, 18]]))37 38 39-- Grouping test cases40tests :: Test41tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2, TestLabel "Test3" test3, TestLabel "Test4" test4, TestLabel "Test5" test5, TestLabel "Test6" test6, TestLabel "Test7" test7, TestLabel "Test8" test8, TestLabel "Test9" test9]42 43-- Running the tests44main :: IO Counts45main = runTestTT tests46