summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]TestAufgabeFFP1.hs16
-rwxr-xr-x[-rw-r--r--]TestAufgabeFFP2.hs16
-rwxr-xr-x[-rw-r--r--]TestAufgabeFFP3.hs19
-rwxr-xr-x[-rw-r--r--]TestAufgabeFFP4.hs16
-rwxr-xr-x[-rw-r--r--]TestAufgabeFFP5.hs15
-rwxr-xr-x[-rw-r--r--]TestAufgabeFFP6.hs15
-rwxr-xr-x[-rw-r--r--]TestAufgabeFFP7.hs15
7 files changed, 95 insertions, 17 deletions
diff --git a/TestAufgabeFFP1.hs b/TestAufgabeFFP1.hs
index 4a38f3c..d1152f4 100644..100755
--- a/TestAufgabeFFP1.hs
+++ b/TestAufgabeFFP1.hs
@@ -1,7 +1,11 @@
1#!/usr/bin/runhugs +l
2
1module Main where 3module Main where
2 4
3import Test.HUnit 5import Test.HUnit
4import Control.Monad 6import Control.Monad
7import System
8import Data.Array
5import AufgabeFFP1 9import AufgabeFFP1
6 10
7assertBoolF :: String -> Bool -> Assertion 11assertBoolF :: String -> Bool -> Assertion
@@ -79,6 +83,14 @@ fibspdTests = TestList [fibspd1]
79tests :: [Test] 83tests :: [Test]
80tests = [pof2s1, pdTests, fibdiagTests, fibdiagsTests, fibspdTests] 84tests = [pof2s1, pdTests, fibdiagTests, fibdiagsTests, fibspdTests]
81 85
86isSuccess :: Counts -> Bool
87isSuccess Counts{ cases = _, tried = _, errors = 0, failures = 0 } = True
88isSuccess Counts{ cases = _, tried = _, errors = _, failures = _ } = False
89
90runTest :: Test -> IO ()
91runTest test = do
92 result <- runTestTT test
93 unless (isSuccess result) exitFailure
94
82main = do 95main = do
83 forM tests $ \test -> 96 forM tests $ (\test -> runTest test)
84 runTestTT test
diff --git a/TestAufgabeFFP2.hs b/TestAufgabeFFP2.hs
index 1131e04..6399c45 100644..100755
--- a/TestAufgabeFFP2.hs
+++ b/TestAufgabeFFP2.hs
@@ -1,7 +1,11 @@
1#!/usr/bin/runhugs +l
2
1module Main where 3module Main where
2 4
3import Test.HUnit 5import Test.HUnit
4import Control.Monad 6import Control.Monad
7import System
8import Data.Array
5import AufgabeFFP2 9import AufgabeFFP2
6 10
7cases1 = TestLabel "pps" $ TestList [ 11cases1 = TestLabel "pps" $ TestList [
@@ -39,6 +43,14 @@ cases4 = TestLabel "gz/gzs" $ TestList [
39tests :: [Test] 43tests :: [Test]
40tests = [cases1, cases2, cases3, cases4] 44tests = [cases1, cases2, cases3, cases4]
41 45
46isSuccess :: Counts -> Bool
47isSuccess Counts{ cases = _, tried = _, errors = 0, failures = 0 } = True
48isSuccess Counts{ cases = _, tried = _, errors = _, failures = _ } = False
49
50runTest :: Test -> IO ()
51runTest test = do
52 result <- runTestTT test
53 unless (isSuccess result) exitFailure
54
42main = do 55main = do
43 forM tests $ \test -> 56 forM tests $ (\test -> runTest test)
44 runTestTT test
diff --git a/TestAufgabeFFP3.hs b/TestAufgabeFFP3.hs
index 065401d..30a915e 100644..100755
--- a/TestAufgabeFFP3.hs
+++ b/TestAufgabeFFP3.hs
@@ -1,10 +1,13 @@
1#!/usr/bin/runhugs +l
2
1module Main where 3module Main where
2 4
3import Prelude hiding (filter) 5import Prelude hiding (filter)
4 6
5
6import Test.HUnit 7import Test.HUnit
7import Control.Monad 8import Control.Monad
9import System
10import Data.Array
8import AufgabeFFP3 11import AufgabeFFP3
9 12
10cases1 = TestLabel "foo" $ TestList [ 13cases1 = TestLabel "foo" $ TestList [
@@ -33,11 +36,17 @@ 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] ] ) 36 TestCase $ assertEqual "a" ( [binomS (n, k) | k <- [0..50], n <- [k..50] ] ) ( [binomM (n, k) | k <- [0..50], n <- [k..50] ] )
34 ] 37 ]
35 38
36
37tests :: [Test] 39tests :: [Test]
38tests = [cases1, cases2, cases3, cases4] 40tests = [cases1, cases2, cases3, cases4]
39 41
40main = do 42isSuccess :: Counts -> Bool
41 forM tests $ \test -> 43isSuccess Counts{ cases = _, tried = _, errors = 0, failures = 0 } = True
42 runTestTT test 44isSuccess Counts{ cases = _, tried = _, errors = _, failures = _ } = False
45
46runTest :: Test -> IO ()
47runTest test = do
48 result <- runTestTT test
49 unless (isSuccess result) exitFailure
43 50
51main = do
52 forM tests $ (\test -> runTest test)
diff --git a/TestAufgabeFFP4.hs b/TestAufgabeFFP4.hs
index ff341e5..1c20e87 100644..100755
--- a/TestAufgabeFFP4.hs
+++ b/TestAufgabeFFP4.hs
@@ -1,7 +1,11 @@
1#!/usr/bin/runhugs +l
2
1module Main where 3module Main where
2 4
3import Test.HUnit 5import Test.HUnit
4import Control.Monad 6import Control.Monad
7import System
8import Data.Array
5import AufgabeFFP4 9import AufgabeFFP4
6 10
7------------------------------------------------------------------------------- 11-------------------------------------------------------------------------------
@@ -70,6 +74,14 @@ cases2 = TestLabel "binomDyn" $ TestList [
70tests :: [Test] 74tests :: [Test]
71tests = [cases1, cases2] 75tests = [cases1, cases2]
72 76
77isSuccess :: Counts -> Bool
78isSuccess Counts{ cases = _, tried = _, errors = 0, failures = 0 } = True
79isSuccess Counts{ cases = _, tried = _, errors = _, failures = _ } = False
80
81runTest :: Test -> IO ()
82runTest test = do
83 result <- runTestTT test
84 unless (isSuccess result) exitFailure
85
73main = do 86main = do
74 forM tests $ \test -> 87 forM tests $ (\test -> runTest test)
75 runTestTT test
diff --git a/TestAufgabeFFP5.hs b/TestAufgabeFFP5.hs
index 865f503..cbdd05b 100644..100755
--- a/TestAufgabeFFP5.hs
+++ b/TestAufgabeFFP5.hs
@@ -1,7 +1,10 @@
1#!/usr/bin/runhugs +l
2
1module Main where 3module Main where
2 4
3import Test.HUnit 5import Test.HUnit
4import Control.Monad 6import Control.Monad
7import System
5import Data.Array 8import Data.Array
6import AufgabeFFP5 9import AufgabeFFP5
7 10
@@ -65,6 +68,14 @@ cases4 = TestLabel "minIndex" $ TestList [
65tests :: [Test] 68tests :: [Test]
66tests = [cases1, cases2, cases3, cases4] 69tests = [cases1, cases2, cases3, cases4]
67 70
71isSuccess :: Counts -> Bool
72isSuccess Counts{ cases = _, tried = _, errors = 0, failures = 0 } = True
73isSuccess Counts{ cases = _, tried = _, errors = _, failures = _ } = False
74
75runTest :: Test -> IO ()
76runTest test = do
77 result <- runTestTT test
78 unless (isSuccess result) exitFailure
79
68main = do 80main = do
69 forM tests $ \test -> 81 forM tests $ (\test -> runTest test)
70 runTestTT test
diff --git a/TestAufgabeFFP6.hs b/TestAufgabeFFP6.hs
index 1f661e6..9849a1a 100644..100755
--- a/TestAufgabeFFP6.hs
+++ b/TestAufgabeFFP6.hs
@@ -1,7 +1,10 @@
1#!/usr/bin/runhugs -X-98 +o +l
2
1module Main where 3module Main where
2 4
3import Test.HUnit 5import Test.HUnit
4import Control.Monad 6import Control.Monad
7import System
5import AufgabeFFP6 8import AufgabeFFP6
6import Data.Array 9import Data.Array
7 10
@@ -81,6 +84,14 @@ cases4 = TestLabel "yield" $ TestList [
81tests :: [Test] 84tests :: [Test]
82tests = [cases1, cases2, cases3, cases4] 85tests = [cases1, cases2, cases3, cases4]
83 86
87isSuccess :: Counts -> Bool
88isSuccess Counts{ cases = _, tried = _, errors = 0, failures = 0 } = True
89isSuccess Counts{ cases = _, tried = _, errors = _, failures = _ } = False
90
91runTest :: Test -> IO ()
92runTest test = do
93 result <- runTestTT test
94 unless (isSuccess result) exitFailure
95
84main = do 96main = do
85 forM tests $ \test -> 97 forM tests $ (\test -> runTest test)
86 runTestTT test
diff --git a/TestAufgabeFFP7.hs b/TestAufgabeFFP7.hs
index 116a445..f83952b 100644..100755
--- a/TestAufgabeFFP7.hs
+++ b/TestAufgabeFFP7.hs
@@ -1,7 +1,10 @@
1#!/usr/bin/runhugs +l
2
1module Main where 3module Main where
2 4
3import Test.HUnit 5import Test.HUnit
4import Control.Monad 6import Control.Monad
7import System
5import AufgabeFFP7 8import AufgabeFFP7
6import Test.QuickCheck 9import Test.QuickCheck
7import System.IO.Unsafe 10import System.IO.Unsafe
@@ -34,6 +37,14 @@ cases2 = TestLabel "ssfn/minfree" $ TestList [
34tests :: [Test] 37tests :: [Test]
35tests = [cases2] 38tests = [cases2]
36 39
40isSuccess :: Counts -> Bool
41isSuccess Counts{ cases = _, tried = _, errors = 0, failures = 0 } = True
42isSuccess Counts{ cases = _, tried = _, errors = _, failures = _ } = False
43
44runTest :: Test -> IO ()
45runTest test = do
46 result <- runTestTT test
47 unless (isSuccess result) exitFailure
48
37main = do 49main = do
38 forM tests $ \test -> 50 forM tests $ (\test -> runTest test)
39 runTestTT test