source: sizechecking/branches/macs/tests/OpsTest.hs @ 21

Last change on this file since 21 was 21, checked in by gobi, 11 years ago

operators

File size: 571 bytes
RevLine 
[21]1{-# LANGUAGE NoMonomorphismRestriction #-}
2
3module Tests.OpsTest where
4
5import Ops
6import Lambda
7import Prelude ( ($), Int, (==), return, sequence, (>>=), and, (.), IO, Bool )
8import qualified Control.Monad
9
10test1 :: (LOps l) => l Int
11test1 = app (lam $ \x -> const 3 + x) (const 2)
12
13test1ast :: IO Bool
14test1ast = do
15    t <- ast test1
16    return $ t "" == "(λa.3+a) 2"
17test1eval :: IO Bool
18test1eval = return $ eval test1 == 5
19
20tests :: [IO Bool]
21tests = [ 
22      test1ast
23    , test1eval
24    ]
25
26runTests :: IO Bool
27runTests = Control.Monad.liftM and $ sequence tests
Note: See TracBrowser for help on using the repository browser.