summaryrefslogtreecommitdiffstats
path: root/TestAufgabeFFP6.hs
diff options
context:
space:
mode:
Diffstat (limited to 'TestAufgabeFFP6.hs')
-rwxr-xr-x[-rw-r--r--]TestAufgabeFFP6.hs15
1 files changed, 13 insertions, 2 deletions
diff --git a/TestAufgabeFFP6.hs b/TestAufgabeFFP6.hs
index 1f661e6..9849a1a 100644..100755
--- a/TestAufgabeFFP6.hs
+++ b/TestAufgabeFFP6.hs
@@ -1,7 +1,10 @@
1#!/usr/bin/runhugs -X-98 +o +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 AufgabeFFP6 8import AufgabeFFP6
6import Data.Array 9import Data.Array
7 10
@@ -81,6 +84,14 @@ cases4 = TestLabel "yield" $ TestList [
81tests :: [Test] 84tests :: [Test]
82tests = [cases1, cases2, cases3, cases4] 85tests = [cases1, cases2, cases3, cases4]
83 86
87isSuccess :: Counts -> Bool
88isSuccess Counts{ cases = _, tried = _, errors = 0, failures = 0 } = True
89isSuccess Counts{ cases = _, tried = _, errors = _, failures = _ } = False
90
91runTest :: Test -> IO ()
92runTest test = do
93 result <- runTestTT test
94 unless (isSuccess result) exitFailure
95
84main = do 96main = do
85 forM tests $ \test -> 97 forM tests $ (\test -> runTest test)
86 runTestTT test