mirror of
https://github.com/grin-compiler/grin.git
synced 2024-10-26 16:51:12 +03:00
Test: Remove invalid contexts.
This commit is contained in:
parent
51aaced70a
commit
6f09e60743
@ -58,8 +58,6 @@ testExprContextE mkSpec =
|
||||
contexts :: [TestExpContext]
|
||||
contexts =
|
||||
[ emptyCtx
|
||||
, firstBindR
|
||||
, middleBindR
|
||||
, lastBindR
|
||||
, bindL
|
||||
, lastBindL
|
||||
@ -68,9 +66,9 @@ contexts =
|
||||
, lastAlt
|
||||
]
|
||||
|
||||
contexts_ :: [TestExpContext]
|
||||
contexts_ =
|
||||
[ bindL
|
||||
contexts1 :: [TestExpContext]
|
||||
contexts1 =
|
||||
[ middleBindR
|
||||
]
|
||||
|
||||
emptyCtx :: TestExpContext
|
||||
@ -78,13 +76,22 @@ emptyCtx = ("empty", id)
|
||||
|
||||
exprText = pack . show . PP
|
||||
|
||||
firstBindR :: TestExpContext
|
||||
firstBindR = ("first bind right", second tr) where
|
||||
firstBindR1 :: TestExpContext
|
||||
firstBindR1 = ("first bind right", second tr) where
|
||||
tr (exprText -> e) = [expr|
|
||||
$e
|
||||
pure ()
|
||||
|]
|
||||
|
||||
changeLast :: Exp -> Exp -> Exp
|
||||
changeLast e (EBind l p r) = EBind l p (changeLast e r)
|
||||
changeLast e r@(ECase{}) = EBind (SBlock r) (Var "cl") e
|
||||
changeLast e r = EBind r (Var "cl") e
|
||||
|
||||
firstBindR :: TestExpContext
|
||||
firstBindR = ("first bind right", second tr) where
|
||||
tr e = changeLast (SReturn (Lit (LInt64 1))) e
|
||||
|
||||
middleBindR :: TestExpContext
|
||||
middleBindR = ("middle bind right", second tr) where
|
||||
tr (exprText -> e) = [expr|
|
||||
@ -100,6 +107,7 @@ lastBindR = ("last bind right", second tr) where
|
||||
$e
|
||||
|]
|
||||
|
||||
|
||||
bindL :: TestExpContext
|
||||
bindL = ("bind left", second tr) where
|
||||
tr (exprText -> e) = [expr|
|
||||
|
Loading…
Reference in New Issue
Block a user