summaryrefslogtreecommitdiffstats
path: root/TestAufgabeFFP4.hs
diff options
context:
space:
mode:
Diffstat (limited to 'TestAufgabeFFP4.hs')
-rwxr-xr-x[-rw-r--r--]TestAufgabeFFP4.hs16
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
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