-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHW02Tests.hs
82 lines (61 loc) · 2.1 KB
/
HW02Tests.hs
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
-- CIS 194, Spring 2015
--
-- Test cases for HW 02
module HW02Tests where
import HW02
import Testing
-- Exercise 1 -----------------------------------------
ex1Tests :: [Test]
ex1Tests = [ testF2 "exactMatches test" exactMatches
[ ([Red, Blue, Green, Yellow], [Blue, Green, Yellow, Red], 0)
, ([Red, Blue, Green, Yellow], [Red, Purple, Green, Orange], 2)
]
]
-- Exercise 2 -----------------------------------------
ex2Tests :: [Test]
ex2Tests = [ testF1 "countColors test" countColors
[ ([Red, Blue, Yellow, Purple], [1, 0, 1, 1, 0, 1])
, ([Green, Blue, Green, Orange], [0, 2, 1, 0, 1, 0])
]
, testF2 "matches test" matches
[ ([Red, Blue, Yellow, Orange], [Red, Orange, Orange, Blue], 3) ]
]
-- Exercise 3 -----------------------------------------
ex3Tests :: [Test]
ex3Tests = [ testF2 "getMove test" getMove
[ ([Red, Blue, Yellow, Orange], [Red, Orange, Orange, Blue],
Move [Red, Orange, Orange, Blue] 1 2)
]
]
-- Exercise 4 -----------------------------------------
ex4Tests :: [Test]
ex4Tests = [ testF2 "isConsistent test" isConsistent
[ (Move [Red, Red, Blue, Green] 1 1, [Red, Blue, Yellow, Purple],
True)
, (Move [Red, Red, Blue, Green] 1 1, [Red, Blue, Red, Purple],
False)
]
]
-- Exercise 5 -----------------------------------------
ex5Tests :: [Test]
ex5Tests = []
-- Exercise 6 -----------------------------------------
ex6Tests :: [Test]
ex6Tests = []
-- Exercise 7 -----------------------------------------
ex7Tests :: [Test]
ex7Tests = []
-- Bonus ----------------------------------------------
bonusTests :: [Test]
bonusTests = []
-- All Tests ------------------------------------------
allTests :: [Test]
allTests = concat [ ex1Tests
, ex2Tests
, ex3Tests
, ex4Tests
, ex5Tests
, ex6Tests
, ex7Tests
, bonusTests
]