Ignore:
Timestamp:
May 3, 2014, 2:45:53 PM (11 years ago)
Author:
gobi
Message:

Expressions

Location:
sizechecking/branches/macs/tests
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • sizechecking/branches/macs/tests/OpsTest.hs

    r21 r22  
    1111test1 = app (lam $ \x -> const 3 + x) (const 2) 
    1212 
     13test2 :: (LOps l) => l Int 
     14test2 = app (lam $ \x -> const 3 * x) (const 2) 
     15 
     16test3 :: (LOps l) => l Int 
     17test3 = app (lam $ \x -> const 2 * x + const 1) (const 5 - const 2) 
     18 
     19 
    1320test1ast :: IO Bool 
    1421test1ast = do 
    1522    t <- ast test1 
    1623    return $ t "" == "(λa.3+a) 2" 
     24 
    1725test1eval :: IO Bool 
    1826test1eval = return $ eval test1 == 5 
     27 
     28test2ast :: IO Bool 
     29test2ast = do 
     30    t <- ast test2 
     31    return $ t "" == "(λa.3*a) 2" 
     32 
     33test2eval :: IO Bool 
     34test2eval = return $ eval test2 == 6 
     35 
     36test3ast :: IO Bool 
     37test3ast = do 
     38    t <- ast test3 
     39    return $ t "" == "(λa.2*a+1) (5-2)" 
     40 
     41test3eval :: IO Bool 
     42test3eval = return $ eval test3 == 7 
    1943 
    2044tests :: [IO Bool] 
Note: See TracChangeset for help on using the changeset viewer.