approximate log stack in handleLogDiscard
This commit is contained in:
parent
567176e076
commit
7a0bc73d25
6 changed files with 33 additions and 12 deletions
|
@ -27,7 +27,7 @@ parameters (label : String) (act : Eff Equal ())
|
|||
testEq = test label $ runEqual globals act
|
||||
|
||||
testNeq : Test
|
||||
testNeq = testThrows label (const True) $ runTC globals act $> "()"
|
||||
testNeq = testThrows label (const True) $ runTC globals act $> "ok"
|
||||
|
||||
|
||||
parameters (ctx : TyContext d n)
|
||||
|
|
|
@ -14,9 +14,10 @@ import Control.Eff
|
|||
|
||||
runWhnf : Eff Whnf a -> Either Error a
|
||||
runWhnf act = runSTErr $ do
|
||||
runEff act [handleExcept (\e => stLeft e),
|
||||
handleStateSTRef !(liftST $ newSTRef 0),
|
||||
handleLogDiscard]
|
||||
runEff act $ with Union.(::)
|
||||
[handleExcept (\e => stLeft e),
|
||||
handleStateSTRef !(newSTRef' 0),
|
||||
handleLogDiscardST !(newSTRef' 0)]
|
||||
|
||||
parameters {0 isRedex : RedexTest tm} {auto _ : CanWhnf tm isRedex} {d, n : Nat}
|
||||
{auto _ : (Eq (tm d n), Show (tm d n))}
|
||||
|
|
|
@ -114,11 +114,11 @@ parameters (label : String) (act : Lazy (Eff Test ()))
|
|||
{default defGlobals globals : Definitions}
|
||||
testTC : Test
|
||||
testTC = test label {e = Error', a = ()} $
|
||||
extract $ runExcept $ runReaderAt DEFS globals act
|
||||
runEff act [handleExcept (\e => Left e), handleReaderConst globals]
|
||||
|
||||
testTCFail : Test
|
||||
testTCFail = testThrows label (const True) $
|
||||
(extract $ runExcept $ runReaderAt DEFS globals act) $> "()"
|
||||
runEff act [handleExcept (\e => Left e), handleReaderConst globals] $> "ok"
|
||||
|
||||
|
||||
inferredTypeEq : TyContext d n -> (exp, got : Term d n) -> Eff Test ()
|
||||
|
|
|
@ -25,8 +25,8 @@ runEqual defs act = runSTErr $ do
|
|||
runEff act $ with Union.(::)
|
||||
[handleExcept (\e => stLeft e),
|
||||
handleReaderConst defs,
|
||||
handleStateSTRef !(liftST $ newSTRef 0),
|
||||
handleLogDiscard]
|
||||
handleStateSTRef !(newSTRef' 0),
|
||||
handleLogDiscardST !(newSTRef' 0)]
|
||||
|
||||
export
|
||||
runTC : Definitions -> Eff TC a -> Either Error a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue