|
|
| module Main where |
| import Test.HUnit |
|
|
| |
|
|
| |
|
|
| |
|
|
| test1 :: Test |
| test1 = TestCase (assertEqual "for (buyChoco [1,2,2] 3)," 0 (buyChoco [1,2,2] 3)) |
|
|
| test2 :: Test |
| test2 = TestCase (assertEqual "for (buyChoco [3,2,3] 3)," 3 (buyChoco [3,2,3] 3)) |
|
|
| test3 :: Test |
| test3 = TestCase (assertEqual "for (buyChoco [61, 75, 67] 77)," 77 (buyChoco [61, 75, 67] 77)) |
|
|
| test4 :: Test |
| test4 = TestCase (assertEqual "for (buyChoco [81, 8, 10, 44, 100, 38, 7, 47] 64)," 49 (buyChoco [81, 8, 10, 44, 100, 38, 7, 47] 64)) |
|
|
| test5 :: Test |
| test5 = TestCase (assertEqual "for (buyChoco [19, 6, 24, 7, 94, 40, 97, 60, 82, 62, 53, 12, 8, 56, 42, 48, 85, 76, 34, 29, 57, 28, 17, 31, 36, 3, 90, 92, 78, 64, 80, 84, 50, 39, 73, 86, 41, 11, 95, 88, 37, 1, 27] 2)," 2 (buyChoco [19, 6, 24, 7, 94, 40, 97, 60, 82, 62, 53, 12, 8, 56, 42, 48, 85, 76, 34, 29, 57, 28, 17, 31, 36, 3, 90, 92, 78, 64, 80, 84, 50, 39, 73, 86, 41, 11, 95, 88, 37, 1, 27] 2)) |
|
|
| test6 :: Test |
| test6 = TestCase (assertEqual "for (buyChoco [60, 32, 4, 35, 36, 45] 38)," 2 (buyChoco [60, 32, 4, 35, 36, 45] 38)) |
|
|
| test7 :: Test |
| test7 = TestCase (assertEqual "for (buyChoco [51, 80, 78, 44, 72, 50, 74, 81, 30, 63, 58, 43, 16, 65, 39, 66, 96, 42, 31, 17, 15, 92, 25, 75, 6, 33, 45, 14] 7)," 7 (buyChoco [51, 80, 78, 44, 72, 50, 74, 81, 30, 63, 58, 43, 16, 65, 39, 66, 96, 42, 31, 17, 15, 92, 25, 75, 6, 33, 45, 14] 7)) |
|
|
| test8 :: Test |
| test8 = TestCase (assertEqual "for (buyChoco [14, 55, 19, 73, 75, 69, 88, 18, 28, 22, 2, 72, 29, 5, 17, 64, 68, 60, 3, 96, 95, 47, 7, 53, 78, 70, 21, 84, 46, 27, 38] 37)," 32 (buyChoco [14, 55, 19, 73, 75, 69, 88, 18, 28, 22, 2, 72, 29, 5, 17, 64, 68, 60, 3, 96, 95, 47, 7, 53, 78, 70, 21, 84, 46, 27, 38] 37)) |
|
|
| test9 :: Test |
| test9 = TestCase (assertEqual "for (buyChoco [51, 50, 22, 39, 21, 23, 99, 97, 66, 41, 3, 79, 89, 91, 31, 35, 14, 5, 11, 71, 38, 82, 7, 84, 48, 30, 28, 90, 58, 60, 94, 53, 9, 87, 47, 72, 74, 75, 25, 43, 4, 57, 86] 41)," 34 (buyChoco [51, 50, 22, 39, 21, 23, 99, 97, 66, 41, 3, 79, 89, 91, 31, 35, 14, 5, 11, 71, 38, 82, 7, 84, 48, 30, 28, 90, 58, 60, 94, 53, 9, 87, 47, 72, 74, 75, 25, 43, 4, 57, 86] 41)) |
|
|
|
|
| |
| tests :: Test |
| tests = 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] |
|
|
| |
| main :: IO Counts |
| main = runTestTT tests |
|
|