aboutsummaryrefslogtreecommitdiffstats
path: root/test/TestUtils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'test/TestUtils.hs')
-rw-r--r--test/TestUtils.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/TestUtils.hs b/test/TestUtils.hs
index 86b3db5..1f0d386 100644
--- a/test/TestUtils.hs
+++ b/test/TestUtils.hs
@@ -1,6 +1,8 @@
{-# OPTIONS_GHC -Wno-missing-export-lists #-}
module TestUtils where
+import qualified Data.Map as M
+import qualified Data.Bifunctor as B
import Utils
testConfig :: Config
@@ -35,6 +37,9 @@ expectErrorL env lc =
Left (LException _ err) -> return err
Right (val, _) -> error $ "unexpected success: " ++ show val
+makeEnv :: [(String, AST)] -> Env
+makeEnv = M.fromList . map (B.second Regular)
+
ast :: ASTNode -> AST
ast node = AST { an = node }