summaryrefslogtreecommitdiffstats
path: root/TestAufgabeFFP1.hs
diff options
context:
space:
mode:
Diffstat (limited to 'TestAufgabeFFP1.hs')
-rw-r--r--TestAufgabeFFP1.hs24
1 files changed, 18 insertions, 6 deletions
diff --git a/TestAufgabeFFP1.hs b/TestAufgabeFFP1.hs
index 7cbc2c2..1fa5c35 100644
--- a/TestAufgabeFFP1.hs
+++ b/TestAufgabeFFP1.hs
@@ -10,17 +10,20 @@ assertBoolF msg b = when b (assertFailure msg)
10------------------------------------------------------------------------------- 10-------------------------------------------------------------------------------
11 11
12pof2s1 :: Test 12pof2s1 :: Test
13pof2s1 = TestCase (assertEqual "pof2s" [1,2,4,8,16,32,64,128,256,512] (take 10 pof2s)) 13pof2s1 = TestCase (assertEqual "pof2s"
14 [1,2,4,8,16,32,64,128,256,512]
15 (take 10 pof2s))
14 16
15pof2sTests = TestList [pof2s1] 17pof2sTests = TestList [pof2s1]
16 18
17------------------------------------------------------------------------------- 19-------------------------------------------------------------------------------
18 20
19pd1 :: Test 21pd1 :: Test
20pd1 = TestCase (assertEqual "pd" [[1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1], 22pd1 = TestCase (assertEqual "pd"
21 [1,5,10,10,5,1], [1,6,15,20,15,6,1], [1,7,21,35,35,21,7,1], 23 [[1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1], [1,5,10,10,5,1],
22 [1,8,28,56,70,56,28,8,1], [1,9,36,84,126,126,84,36,9,1], 24 [1,6,15,20,15,6,1], [1,7,21,35,35,21,7,1], [1,8,28,56,70,56,28,8,1],
23 [1,10,45,120,210,252,210,120,45,10,1]] (take 11 pd)) 25 [1,9,36,84,126,126,84,36,9,1], [1,10,45,120,210,252,210,120,45,10,1]]
26 (take 11 pd))
24 27
25pdTests = TestList [pd1] 28pdTests = TestList [pd1]
26 29
@@ -55,8 +58,17 @@ fibdiagTests = TestList [fibdiag1, fibdiag2, fibdiag3, fibdiag4, fibdiag5,
55 58
56------------------------------------------------------------------------------- 59-------------------------------------------------------------------------------
57 60
61fibdiags1 :: Test
62fibdiags1 = TestCase (assertEqual "fibdiags"
63 [[1], [1], [1,1], [1,2], [1,3,1], [1,4,3], [1,5,6,1], [1,6,10,4]]
64 (take 8 fibdiags))
65
66fibdiagsTests = TestList [fibdiags1]
67
68-------------------------------------------------------------------------------
69
58tests :: [Test] 70tests :: [Test]
59tests = [pof2s1, pdTests, fibdiagTests] 71tests = [pof2s1, pdTests, fibdiagTests, fibdiagsTests]
60 72
61main = do 73main = do
62 forM tests $ \test -> 74 forM tests $ \test ->