summaryrefslogtreecommitdiffstats
path: root/TestAufgabeFFP6.hs
diff options
context:
space:
mode:
Diffstat (limited to 'TestAufgabeFFP6.hs')
-rw-r--r--TestAufgabeFFP6.hs22
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 @@
1module Main where
2
3import Test.HUnit
4import Control.Monad
5import AufgabeFFP6
6import Data.Array
7
8cases1 = 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
17tests :: [Test]
18tests = [cases1]
19
20main = do
21 forM tests $ \test ->
22 runTestTT test