diff options
Diffstat (limited to 'TestAufgabeFFP4.hs')
| -rwxr-xr-x[-rw-r--r--] | TestAufgabeFFP4.hs | 16 |
1 files changed, 14 insertions, 2 deletions
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 | |||
| 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 AufgabeFFP4 | 9 | import AufgabeFFP4 |
| 6 | 10 | ||
| 7 | ------------------------------------------------------------------------------- | 11 | ------------------------------------------------------------------------------- |
| @@ -70,6 +74,14 @@ cases2 = TestLabel "binomDyn" $ TestList [ | |||
| 70 | tests :: [Test] | 74 | tests :: [Test] |
| 71 | tests = [cases1, cases2] | 75 | tests = [cases1, cases2] |
| 72 | 76 | ||
| 77 | isSuccess :: Counts -> Bool | ||
| 78 | isSuccess Counts{ cases = _, tried = _, errors = 0, failures = 0 } = True | ||
| 79 | isSuccess Counts{ cases = _, tried = _, errors = _, failures = _ } = False | ||
| 80 | |||
| 81 | runTest :: Test -> IO () | ||
| 82 | runTest test = do | ||
| 83 | result <- runTestTT test | ||
| 84 | unless (isSuccess result) exitFailure | ||
| 85 | |||
| 73 | main = do | 86 | main = do |
| 74 | forM tests $ \test -> | 87 | forM tests $ (\test -> runTest test) |
| 75 | runTestTT test | ||
