mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-12 12:49:13 +03:00
63291c53af
* refactor: use Set for used modules * fix: fix lookup test
25 lines
651 B
Haskell
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))
|