diff options
Diffstat (limited to 'TestAufgabeFFP1.hs')
| -rwxr-xr-x[-rw-r--r--] | TestAufgabeFFP1.hs | 16 |
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 | |||
| 1 | module Main where | 3 | module Main where |
| 2 | 4 | ||
| 3 | import Test.HUnit | 5 | import Test.HUnit |
| 4 | import Control.Monad | 6 | import Control.Monad |
| 7 | import System | ||
| 8 | import Data.Array | ||
| 5 | import AufgabeFFP1 | 9 | import AufgabeFFP1 |
| 6 | 10 | ||
| 7 | assertBoolF :: String -> Bool -> Assertion | 11 | assertBoolF :: String -> Bool -> Assertion |
| @@ -79,6 +83,14 @@ fibspdTests = TestList [fibspd1] | |||
| 79 | tests :: [Test] | 83 | tests :: [Test] |
| 80 | tests = [pof2s1, pdTests, fibdiagTests, fibdiagsTests, fibspdTests] | 84 | tests = [pof2s1, pdTests, fibdiagTests, fibdiagsTests, fibspdTests] |
| 81 | 85 | ||
| 86 | isSuccess :: Counts -> Bool | ||
| 87 | isSuccess Counts{ cases = _, tried = _, errors = 0, failures = 0 } = True | ||
| 88 | isSuccess Counts{ cases = _, tried = _, errors = _, failures = _ } = False | ||
| 89 | |||
| 90 | runTest :: Test -> IO () | ||
| 91 | runTest test = do | ||
| 92 | result <- runTestTT test | ||
| 93 | unless (isSuccess result) exitFailure | ||
| 94 | |||
| 82 | main = do | 95 | main = do |
| 83 | forM tests $ \test -> | 96 | forM tests $ (\test -> runTest test) |
| 84 | runTestTT test | ||
