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