diff options
Diffstat (limited to 'TestAufgabeFFP6.hs')
| -rw-r--r-- | TestAufgabeFFP6.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/TestAufgabeFFP6.hs b/TestAufgabeFFP6.hs new file mode 100644 index 0000000..86bd75d --- /dev/null +++ b/TestAufgabeFFP6.hs | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | module Main where | ||
| 2 | |||
| 3 | import Test.HUnit | ||
| 4 | import Control.Monad | ||
| 5 | import AufgabeFFP6 | ||
| 6 | import Data.Array | ||
| 7 | |||
| 8 | cases1 = TestLabel "eval" $ TestList [ | ||
| 9 | TestCase $ assertEqual "eval1" (0) | ||
| 10 | (eval (array (1,3) [(1,1), (2,2), (3,3)]) (array (1,2) [(1,(+)), (2,(-))])), | ||
| 11 | TestCase $ assertEqual "eval2" (5) | ||
| 12 | (eval (array (1,3) [(1,1), (2,2), (3,3)]) (array (1,2) [(1,(*)), (2,(+))])), | ||
| 13 | TestCase $ assertEqual "eval3" (-3) | ||
| 14 | (eval (array (1,3) [(1,1), (2,2), (3,3)]) (array (1,2) [(1,(-)), (2,(*))])) | ||
| 15 | ] | ||
| 16 | |||
| 17 | tests :: [Test] | ||
| 18 | tests = [cases1] | ||
| 19 | |||
| 20 | main = do | ||
| 21 | forM tests $ \test -> | ||
| 22 | runTestTT test | ||
