File size: 2,690 Bytes
24e07f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

module Main where
import Test.HUnit

--Program start
satisfiesConditions :: [[Int]] -> Bool
satisfiesConditions grid = undefined

--Program end

-- Test cases

test1 :: Test
test1 = TestCase (assertEqual "for (satisfiesConditions [[1,0,2],[1,0,2]])," True (satisfiesConditions [[1,0,2],[1,0,2]]))

test2 :: Test
test2 = TestCase (assertEqual "for (satisfiesConditions [[1,1,1],[0,0,0]])," False (satisfiesConditions [[1,1,1],[0,0,0]]))

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

test4 :: Test
test4 = TestCase (assertEqual "for (satisfiesConditions [[7, 6, 4, 7, 1, 8, 9, 7], [3, 8, 3, 5, 3, 7, 6, 6], [3, 2, 7, 1, 3, 1, 1, 4], [0, 2, 4, 9, 3, 1, 4, 5], [0, 2, 9, 7, 5, 3, 4, 1], [1, 5, 4, 4, 9, 6, 9, 3], [2, 9, 8, 5, 3, 7, 2, 1], [9, 4, 0, 6, 1, 7, 4, 1], [5, 9, 9, 6, 5, 6, 5, 8], [4, 0, 7, 1, 6, 2, 9, 7]])," False (satisfiesConditions [[7, 6, 4, 7, 1, 8, 9, 7], [3, 8, 3, 5, 3, 7, 6, 6], [3, 2, 7, 1, 3, 1, 1, 4], [0, 2, 4, 9, 3, 1, 4, 5], [0, 2, 9, 7, 5, 3, 4, 1], [1, 5, 4, 4, 9, 6, 9, 3], [2, 9, 8, 5, 3, 7, 2, 1], [9, 4, 0, 6, 1, 7, 4, 1], [5, 9, 9, 6, 5, 6, 5, 8], [4, 0, 7, 1, 6, 2, 9, 7]]))

test5 :: Test
test5 = TestCase (assertEqual "for (satisfiesConditions [[0, 9], [1, 5], [0, 1], [9, 9], [9, 7], [0, 0], [4, 6], [0, 8], [0, 9]])," False (satisfiesConditions [[0, 9], [1, 5], [0, 1], [9, 9], [9, 7], [0, 0], [4, 6], [0, 8], [0, 9]]))

test6 :: Test
test6 = TestCase (assertEqual "for (satisfiesConditions [[9, 8, 8, 3, 0, 8, 7, 9, 9, 4], [1, 9, 9, 0, 2, 9, 7, 1, 9, 9], [3, 0, 6, 8, 3, 6, 5, 0, 2, 0], [8, 1, 1, 7, 2, 2, 3, 1, 0, 8], [5, 4, 5, 5, 2, 7, 8, 6, 8, 2], [1, 0, 8, 8, 2, 1, 1, 4, 4, 6]])," False (satisfiesConditions [[9, 8, 8, 3, 0, 8, 7, 9, 9, 4], [1, 9, 9, 0, 2, 9, 7, 1, 9, 9], [3, 0, 6, 8, 3, 6, 5, 0, 2, 0], [8, 1, 1, 7, 2, 2, 3, 1, 0, 8], [5, 4, 5, 5, 2, 7, 8, 6, 8, 2], [1, 0, 8, 8, 2, 1, 1, 4, 4, 6]]))

test7 :: Test
test7 = TestCase (assertEqual "for (satisfiesConditions [[9, 8, 0, 7], [7, 8, 9, 4], [5, 1, 7, 6], [0, 2, 1, 3], [4, 1, 4, 7], [6, 4, 6, 0], [0, 8, 1, 3], [9, 5, 3, 8]])," False (satisfiesConditions [[9, 8, 0, 7], [7, 8, 9, 4], [5, 1, 7, 6], [0, 2, 1, 3], [4, 1, 4, 7], [6, 4, 6, 0], [0, 8, 1, 3], [9, 5, 3, 8]]))

test8 :: Test
test8 = TestCase (assertEqual "for (satisfiesConditions [[3], [1], [9]])," False (satisfiesConditions [[3], [1], [9]]))


-- Grouping test cases
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]

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