Carp/test/TestLookup.hs
Veit Heller 63291c53af
refactor: use Set for used modules (#1150)
* refactor: use Set for used modules

* fix: fix lookup test
2021-01-25 21:18:01 +01:00

25 lines
651 B
Haskell

module TestLookup where
import qualified Lookup as Lookup
import qualified Map
import qualified Set
import Obj
import Test.HUnit
import Types
testLookup :: [Test]
testLookup =
[ basicLookup
]
b1 = Binder emptyMeta (XObj (Str "b1") Nothing (Just StringTy))
emptyRootEnv = Env (Map.fromList []) Nothing Nothing Set.empty ExternalEnv 0
assertNotFound :: Maybe Binder -> Test
assertNotFound Nothing = TestCase (assertBool "assertNotFound" True) -- Better way?
assertNotFound _ = TestCase (assertBool "assertNotFound" False)
basicLookup :: Test
basicLookup = assertNotFound (fmap snd (Lookup.lookupInEnv (SymPath [] "nonexisting") emptyRootEnv))