source: sizechecking/branches/macs/Tests/LambdaTest.hs @ 25

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

expressions

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