summaryrefslogtreecommitdiffstats
path: root/TestAufgabeFFP6.hs
blob: 86bd75d63e1454c84055f80f7fd40d64b06bfc94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Main where

import Test.HUnit
import Control.Monad
import AufgabeFFP6
import Data.Array

cases1 = TestLabel "eval" $ TestList [
  TestCase $ assertEqual "eval1" (0)
    (eval (array (1,3) [(1,1), (2,2), (3,3)]) (array (1,2) [(1,(+)), (2,(-))])),
  TestCase $ assertEqual "eval2" (5)
    (eval (array (1,3) [(1,1), (2,2), (3,3)]) (array (1,2) [(1,(*)), (2,(+))])),
  TestCase $ assertEqual "eval3" (-3)
    (eval (array (1,3) [(1,1), (2,2), (3,3)]) (array (1,2) [(1,(-)), (2,(*))]))
  ]

tests :: [Test]
tests = [cases1]

main = do
  forM tests $ \test ->
    runTestTT test