namespaces work now

This commit is contained in:
rhiannon morris 2023-04-17 23:58:24 +02:00
parent 4db373a84f
commit 4578b30c79
9 changed files with 291 additions and 252 deletions

View file

@ -21,10 +21,10 @@ defGlobals = fromList
parameters (label : String) (act : Lazy (TC ()))
{default defGlobals globals : Definitions}
testEq : Test
testEq = test label $ runTC globals act
testEq = test label $ runTC [<] globals act
testNeq : Test
testNeq = testThrows label (const True) $ runTC globals act $> "()"
testNeq = testThrows label (const True) $ runTC [<] globals act $> "()"
parameters (0 d : Nat) (ctx : TyContext d n)

View file

@ -13,7 +13,7 @@ parameters {0 isRedex : RedexTest tm} {auto _ : Whnf tm isRedex} {d, n : Nat}
private
testWhnf : String -> WhnfContext d n -> tm d n -> tm d n -> Test
testWhnf label ctx from to = test "\{label} (whnf)" $ do
result <- bimap toInfo fst $ whnf defs ctx from
result <- bimap toInfo fst $ whnf [<] defs ctx from
unless (result == to) $ Left [("exp", show to), ("got", show result)]
private

View file

@ -28,7 +28,7 @@ ToInfo Error' where
M = Eff [Except Error', DefsReader]
inj : TC a -> M a
inj = rethrow . mapFst TCError <=< lift . runExcept
inj = rethrow . mapFst TCError <=< lift . runExcept . runReaderAt NS [<]
reflTy : Term d n
@ -90,11 +90,11 @@ parameters (label : String) (act : Lazy (M ()))
{default defGlobals globals : Definitions}
testTC : Test
testTC = test label {e = Error', a = ()} $
extract $ runExcept $ runReader globals act
extract $ runExcept $ runReaderAt DEFS globals act
testTCFail : Test
testTCFail = testThrows label (const True) $
(extract $ runExcept $ runReader globals act) $> "()"
(extract $ runExcept $ runReaderAt DEFS globals act) $> "()"
anys : {n : Nat} -> QContext n