summaryrefslogtreecommitdiffstats
path: root/TestAufgabeFFP1.hs
diff options
context:
space:
mode:
Diffstat (limited to 'TestAufgabeFFP1.hs')
-rwxr-xr-x[-rw-r--r--]TestAufgabeFFP1.hs16
1 files changed, 14 insertions, 2 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