File size: 781 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

module Main where
import Test.HUnit

--Program start

--Program end

-- Test cases

test1 :: Test
test1 = TestCase (assertEqual "for (bestHand [13,2,3,1,9] [ \"a \", \"a \", \"a \", \"a \", \"a \"])," "Flush" (bestHand [13,2,3,1,9] ["a","a","a","a","a"]))

test2 :: Test
test2 = TestCase (assertEqual "for (bestHand [4,4,2,4,4] [ \"d \", \"a \", \"a \", \"b \", \"c \"])," "ThreeofaKind" (bestHand [4,4,2,4,4] ["d","a","a","b","c"]))

test3 :: Test
test3 = TestCase (assertEqual "for (bestHand [10,10,2,12,9] [ \"a \", \"b \", \"c \", \"a \", \"d \"])," "Pair" (bestHand [10,10,2,12,9] ["a","b","c","a","d"]))


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

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