source: sizechecking/branches/macs/tests/LambdaTest.hs @ 24

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

expressions

File size: 556 bytes
RevLine 
[19]1{-# LANGUAGE NoMonomorphismRestriction #-}
[20]2
[21]3module Tests.LambdaTest where
4
[19]5import Lambda
[21]6import Prelude ( ($), Int, (==), return, sequence, (>>=), and, (.), IO, Bool )
7import qualified Control.Monad
[19]8
9test1 :: (Lambda l) => l Int
[24]10test1 = app (lam $ \_ -> lit 3) (lit 2)
[20]11
[21]12test1ast :: IO Bool
13test1ast = do
14    t <- ast test1
15    return $ t "" == "(λa.3) 2"
[20]16
[21]17test1eval :: IO Bool
18test1eval = return $ eval test1 == 3
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.