summaryrefslogtreecommitdiffstats
path: root/TestAufgabeFFP7.hs
diff options
context:
space:
mode:
Diffstat (limited to 'TestAufgabeFFP7.hs')
-rwxr-xr-x[-rw-r--r--]TestAufgabeFFP7.hs15
1 files changed, 13 insertions, 2 deletions
diff --git a/TestAufgabeFFP7.hs b/TestAufgabeFFP7.hs
index 116a445..f83952b 100644..100755
--- a/TestAufgabeFFP7.hs
+++ b/TestAufgabeFFP7.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 AufgabeFFP7 8import AufgabeFFP7
6import Test.QuickCheck 9import Test.QuickCheck
7import System.IO.Unsafe 10import System.IO.Unsafe
@@ -34,6 +37,14 @@ cases2 = TestLabel "ssfn/minfree" $ TestList [
34tests :: [Test] 37tests :: [Test]
35tests = [cases2] 38tests = [cases2]
36 39
40isSuccess :: Counts -> Bool
41isSuccess Counts{ cases = _, tried = _, errors = 0, failures = 0 } = True
42isSuccess Counts{ cases = _, tried = _, errors = _, failures = _ } = False
43
44runTest :: Test -> IO ()
45runTest test = do
46 result <- runTestTT test
47 unless (isSuccess result) exitFailure
48
37main = do 49main = do
38 forM tests $ \test -> 50 forM tests $ (\test -> runTest test)
39 runTestTT test