File size: 683 Bytes
f7c0146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

module Main where
import Test.HUnit

--Program start

--Program end

-- Test cases

test1 :: Test
test1 = TestCase (assertEqual "for (isGood [2, 1, 3])," False (isGood [2, 1, 3]))

test2 :: Test
test2 = TestCase (assertEqual "for (isGood [1, 3, 3, 2])," True (isGood [1, 3, 3, 2]))

test3 :: Test
test3 = TestCase (assertEqual "for (isGood [1, 1])," True (isGood [1, 1]))

test4 :: Test
test4 = TestCase (assertEqual "for (isGood [3, 4, 4, 1, 2, 1])," False (isGood [3, 4, 4, 1, 2, 1]))


-- Grouping test cases
tests :: Test
tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2, TestLabel "Test3" test3]

-- Running the tests
main :: IO Counts
main = runTestTT tests