summaryrefslogtreecommitdiffstats
path: root/TestAufgabeFFP2.hs
blob: 61fdb511871f1cb80f446a6fb9394d6e3916140a (plain)
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
module Main where

import Test.HUnit
import Control.Monad
import AufgabeFFP2


cases1 = TestLabel "2.1" $ TestList [
	TestCase $ 
		[(3,5),(5,7),(11,13),(17,19),(29,31),(41,43), (59,61),(71,73),(101,103),(107,109)]
		@=? (take 10 pps),
	TestCase $ (347,349) @=? (pps!!20),
	TestCase $ (809,811) @=? (head (drop 30 pps))
	]


cases2 = TestLabel "2.2" $ TestList [
	TestCase $ 1024 @=? (powFast 10),
	TestCase $ (pow 10) @=? (powFast 10),
	TestCase $ 1048576 @=? (powFast 20),
	TestCase $ (pow 20) @=? (powFast 20)
	]


cases3 = TestLabel "2.3" $ TestList [
	TestCase $ (fMT 10 10) @=? (f 10 10),
	TestCase $ (fMT 50 10) @=? (f 50 10),
	TestCase $ (fMT 1000 10) @=? (f 1000 10)
	]


cases4 = TestLabel "2.4" $ TestList [
	TestCase $ 144 @=? (gz 42),
	TestCase $ 400 @=? (gz 402),
	TestCase $ 144 @=? (gzs!!42),
	TestCase $ 400 @=? (gzs!!402)
	]



main = runTestTT $ TestList [cases1, cases2, cases3, cases4]