|
|
| module Main where |
| import Test.HUnit |
|
|
| |
|
|
| |
|
|
| |
|
|
| test1 :: Test |
| test1 = TestCase (assertEqual "for (hasIncreasingSubarrays [2,5,7,8,9,2,3,4,3,1] 3)," True (hasIncreasingSubarrays [2,5,7,8,9,2,3,4,3,1] 3)) |
|
|
| test2 :: Test |
| test2 = TestCase (assertEqual "for (hasIncreasingSubarrays [1,2,3,4,4,4,4,5,6,7] 5)," False (hasIncreasingSubarrays [1,2,3,4,4,4,4,5,6,7] 5)) |
|
|
| test3 :: Test |
| test3 = TestCase (assertEqual "for (hasIncreasingSubarrays [-669, 939, ( -671), ( -764), ( -122), 65, 433, ( -158), 532, ( -539), 634, ( -912), ( -271), 596, 397, 732, ( -474), 665, 518, 851, 3, 290, ( -172), ( -303), ( -856), 594, ( -99), 265, ( -948), ( -66), 381, ( -217), 765, 992, ( -799), ( -962), ( -359), ( -116), ( -737), ( -271), 441, 552, ( -845), ( -663), ( -415), 23, 987] 20)," False (hasIncreasingSubarrays [-669, 939, -671, -764, -122, 65, 433, -158, 532, -539, 634, -912, -271, 596, 397, 732, -474, 665, 518, 851, 3, 290, -172, -303, -856, 594, -99, 265, -948, -66, 381, -217, 765, 992, -799, -962, -359, -116, -737, -271, 441, 552, -845, -663, -415, 23, 987] 20)) |
|
|
| test4 :: Test |
| test4 = TestCase (assertEqual "for (hasIncreasingSubarrays [846, ( -627), 915, ( -300), ( -391), ( -505), 507] 2)," False (hasIncreasingSubarrays [846, -627, 915, -300, -391, -505, 507] 2)) |
|
|
| test5 :: Test |
| test5 = TestCase (assertEqual "for (hasIncreasingSubarrays [871, ( -896), ( -232), 537, 464, 728, ( -10), ( -927), ( -539), ( -113), 928, 555, 775, ( -900), ( -289), 795, ( -849), 450, 253, 450, ( -308), ( -589), ( -563), 848, 119, ( -780), ( -381)] 5)," False (hasIncreasingSubarrays [871, -896, -232, 537, 464, 728, -10, -927, -539, -113, 928, 555, 775, -900, -289, 795, -849, 450, 253, 450, -308, -589, -563, 848, 119, -780, -381] 5)) |
|
|
| test6 :: Test |
| test6 = TestCase (assertEqual "for (hasIncreasingSubarrays [0, ( -807), 367, 485, 105, 174, ( -444), ( -479), ( -440), ( -626), ( -645), 422, 608, 881, ( -2), 147, ( -796), ( -752), 799, ( -782), ( -281), ( -955), ( -700), ( -946), ( -175), 134, 738, ( -983), 441, 284, 545, ( -597), ( -168), ( -53), 702, ( -845), ( -34), 126, ( -351), 842, 257, 59, 821, ( -974), 546, ( -628), ( -55), ( -452), 203, ( -793), ( -251), ( -515), 284] 16)," False (hasIncreasingSubarrays [0, -807, 367, 485, 105, 174, -444, -479, -440, -626, -645, 422, 608, 881, -2, 147, -796, -752, 799, -782, -281, -955, -700, -946, -175, 134, 738, -983, 441, 284, 545, -597, -168, -53, 702, -845, -34, 126, -351, 842, 257, 59, 821, -974, 546, -628, -55, -452, 203, -793, -251, -515, 284] 16)) |
|
|
| test7 :: Test |
| test7 = TestCase (assertEqual "for (hasIncreasingSubarrays [-256, ( -176), 324, ( -573), ( -964), ( -489), ( -141), 884, ( -44), 137, 492, 813, ( -442), 608, ( -455), 971, ( -200), 940, 772, 359, ( -886), ( -454), ( -148), ( -473), ( -344), 18, 292, 137, ( -893), 238, ( -706), 974, ( -980), ( -639), ( -51), 267] 6)," False (hasIncreasingSubarrays [-256, -176, 324, -573, -964, -489, -141, 884, -44, 137, 492, 813, -442, 608, -455, 971, -200, 940, 772, 359, -886, -454, -148, -473, -344, 18, 292, 137, -893, 238, -706, 974, -980, -639, -51, 267] 6)) |
|
|
| test8 :: Test |
| test8 = TestCase (assertEqual "for (hasIncreasingSubarrays [-744, 380, 344, 139, 841, 750, 102, ( -653), ( -428), ( -138), 104, 987, 604, ( -83), ( -428), ( -414), 664, ( -601), 663, ( -907), 190, 180, 926, ( -533), ( -872)] 3)," False (hasIncreasingSubarrays [-744, 380, 344, 139, 841, 750, 102, -653, -428, -138, 104, 987, 604, -83, -428, -414, 664, -601, 663, -907, 190, 180, 926, -533, -872] 3)) |
|
|
| test9 :: Test |
| test9 = TestCase (assertEqual "for (hasIncreasingSubarrays [945, ( -656), 548, ( -31), 150, 186, 646, ( -910), 998, 336, 297, ( -267), 255, 748, ( -171), 488, ( -426), 826, ( -497), ( -228), 558, ( -875), 606, ( -372), ( -83), ( -63), ( -639), 195, 747, ( -795), ( -198), 102, 187, ( -546), ( -325), 414, 839, 890, 959, ( -581), ( -662), 365, 369, 12, ( -955), ( -657), ( -199), 56, ( -141), 382, ( -892), ( -461), 259, ( -574), ( -677), ( -211), ( -170), 889, ( -221), 462, 901, 291, 588, 863, 193, 376, ( -358), ( -677), 620, ( -717), 782, 813, ( -329), ( -424), ( -901)] 18)," False (hasIncreasingSubarrays [945, -656, 548, -31, 150, 186, 646, -910, 998, 336, 297, -267, 255, 748, -171, 488, -426, 826, -497, -228, 558, -875, 606, -372, -83, -63, -639, 195, 747, -795, -198, 102, 187, -546, -325, 414, 839, 890, 959, -581, -662, 365, 369, 12, -955, -657, -199, 56, -141, 382, -892, -461, 259, -574, -677, -211, -170, 889, -221, 462, 901, 291, 588, 863, 193, 376, -358, -677, 620, -717, 782, 813, -329, -424, -901] 18)) |
|
|
|
|
| |
| 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, TestLabel "Test9" test9] |
|
|
| |
| main :: IO Counts |
| main = runTestTT tests |
|
|