-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHW01Tests.hs
53 lines (37 loc) · 1.18 KB
/
HW01Tests.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
-- CIS 194, Spring 2015
--
-- Test cases for HW 01
module HW01Tests where
import HW01
import Testing
-- Exercise 1 -----------------------------------------
testLastDigit :: (Integer, Integer) -> Bool
testLastDigit (n, d) = lastDigit n == d
testDropLastDigit :: (Integer, Integer) -> Bool
testDropLastDigit (n, d) = dropLastDigit n == d
ex1Tests :: [Test]
ex1Tests = [ Test "lastDigit test" testLastDigit
[(123, 3), (1234, 4), (5, 5), (10, 0), (0, 0)]
, Test "dropLastDigit test" testDropLastDigit
[(123, 12), (1234, 123), (5, 0), (10, 1), (0,0)]
]
-- Exercise 2 -----------------------------------------
ex2Tests :: [Test]
ex2Tests = []
-- Exercise 3 -----------------------------------------
ex3Tests :: [Test]
ex3Tests = []
-- Exercise 4 -----------------------------------------
ex4Tests :: [Test]
ex4Tests = []
-- Exercise 5 -----------------------------------------
ex5Tests :: [Test]
ex5Tests = []
-- All Tests ------------------------------------------
allTests :: [Test]
allTests = concat [ ex1Tests
, ex2Tests
, ex3Tests
, ex4Tests
, ex5Tests
]