From ea160e993a7196d0f5aa6749b1ea046f16cf0546 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 8 Dec 2022 00:29:48 +0200 Subject: Add "let memo" syntax for automatic memoization --- test/TestUtils.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/TestUtils.hs') 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 } -- cgit v1.3