diff options
Diffstat (limited to 'TestAufgabeFFP3.hs')
| -rw-r--r-- | TestAufgabeFFP3.hs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/TestAufgabeFFP3.hs b/TestAufgabeFFP3.hs index bbb5fbc..c83099c 100644 --- a/TestAufgabeFFP3.hs +++ b/TestAufgabeFFP3.hs | |||
| @@ -15,8 +15,27 @@ cases1 = TestLabel "foo" $ TestList [ | |||
| 15 | TestCase $ assertEqual "e" ((selector2 . (filter 5) . transformer . generator) [(5,13),(2,7),(2,6),(10,100)]) [([(2,7),(2,6)],4,13)] | 15 | TestCase $ assertEqual "e" ((selector2 . (filter 5) . transformer . generator) [(5,13),(2,7),(2,6),(10,100)]) [([(2,7),(2,6)],4,13)] |
| 16 | ] | 16 | ] |
| 17 | 17 | ||
| 18 | cases2 = TestLabel "bar" $ TestList [ | ||
| 19 | TestCase $ assertEqual "a" [ binomS (8, i) | i <- [0..7] ] [ binom (8, i) | i <- [0..7] ], | ||
| 20 | TestCase $ assertEqual "a" (binom (1,1)) (binomS (1,1)), | ||
| 21 | TestCase $ assertEqual "a" (binom (2,1)) (binomS (2,1)), | ||
| 22 | TestCase $ assertEqual "a" (binom (18,12)) (binomS (18,12)) | ||
| 23 | ] | ||
| 24 | |||
| 25 | cases3 = TestLabel "bar" $ TestList [ | ||
| 26 | TestCase $ assertEqual "a" [ binomM (8, i) | i <- [0..7] ] [ binom (8, i) | i <- [0..7] ], | ||
| 27 | TestCase $ assertEqual "a" (binom (1,1)) (binomM (1,1)), | ||
| 28 | TestCase $ assertEqual "a" (binom (2,1)) (binomM (2,1)), | ||
| 29 | TestCase $ assertEqual "a" (binom (18,12)) (binomM (18,12)) | ||
| 30 | ] | ||
| 31 | |||
| 32 | cases4 = TestLabel "bar" $ TestList [ | ||
| 33 | TestCase $ assertEqual "a" ( [binomS (n, k) | k <- [0..50], n <- [k..50] ] ) ( [binomM (n, k) | k <- [0..50], n <- [k..50] ] ) | ||
| 34 | ] | ||
| 35 | |||
| 36 | |||
| 18 | tests :: [Test] | 37 | tests :: [Test] |
| 19 | tests = [cases1] | 38 | tests = [cases1, cases2, cases3, cases4] |
| 20 | 39 | ||
| 21 | main = do | 40 | main = do |
| 22 | forM tests $ \test -> | 41 | forM tests $ \test -> |
