From fe5d1ec1b76b8cb42359324030e701a719847a50 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Tue, 27 Sep 2022 16:41:27 +0300 Subject: Add shadowing symbol error --- test/TestUtils.hs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'test/TestUtils.hs') diff --git a/test/TestUtils.hs b/test/TestUtils.hs index 5206d27..e497ece 100644 --- a/test/TestUtils.hs +++ b/test/TestUtils.hs @@ -19,15 +19,26 @@ expectSuccessL :: LContext a -> IO a expectSuccessL lc = do res <- testRunL lc case res of - Left (LException err) -> error $ "unexpected error: " ++ err + Left (LException _ err) -> error $ "unexpected error: " ++ err Right val -> return val expectErrorL :: Show a => LContext a -> IO String expectErrorL lc = do res <- testRunL lc case res of - Left (LException err) -> return err + Left (LException _ err) -> return err Right val -> error $ "unexpected success: " ++ show val -wrapAST :: ASTNode -> AST -wrapAST node = AST { astNode = node } +ast :: ASTNode -> AST +ast node = AST { astNode = node } + +astInteger a = ast $ ASTInteger a +astDouble a = ast $ ASTDouble a +astSymbol a = ast $ ASTSymbol a +astBoolean a = ast $ ASTBoolean a +astString a = ast $ ASTString a +astVector a = ast $ ASTVector a +astFunctionCall a = ast $ ASTFunctionCall a +astHashMap a = ast $ ASTHashMap a +astUnit = ast $ ASTUnit +astHole = ast $ ASTHole -- cgit v1.3