mirror of
https://github.com/anoma/juvix.git
synced 2024-12-15 18:13:56 +03:00
fab40c6c99
- Closes #1756
39 lines
989 B
Haskell
39 lines
989 B
Haskell
module Core.Transformation.Lifting (allTests) where
|
|
|
|
import Base
|
|
import Core.Eval.Positive qualified as Eval
|
|
import Core.Transformation.Base
|
|
import Juvix.Compiler.Core.Transformation
|
|
|
|
allTests :: TestTree
|
|
allTests =
|
|
testGroup
|
|
"Lifting"
|
|
[ testGroup "Lambda and LetRec lifting" (map liftTest Eval.tests),
|
|
testGroup "Only LetRec lifting" (map letRecLiftTest Eval.tests)
|
|
]
|
|
|
|
liftTest :: Eval.PosTest -> TestTree
|
|
liftTest _testEval =
|
|
fromTest
|
|
Test
|
|
{ _testTransformations = pipe,
|
|
_testAssertion = \i -> unless (isLifted i) (error "not lambda lifted"),
|
|
_testEval
|
|
}
|
|
where
|
|
pipe :: [TransformationId]
|
|
pipe = [LambdaLetRecLifting]
|
|
|
|
letRecLiftTest :: Eval.PosTest -> TestTree
|
|
letRecLiftTest _testEval =
|
|
fromTest
|
|
Test
|
|
{ _testTransformations = pipe,
|
|
_testAssertion = \i -> unless (isLetRecLifted i) (error "not letrec lifted"),
|
|
_testEval
|
|
}
|
|
where
|
|
pipe :: [TransformationId]
|
|
pipe = [LetRecLifting]
|