diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-09-27 16:41:27 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-05 14:21:53 +0200 |
| commit | fe5d1ec1b76b8cb42359324030e701a719847a50 (patch) | |
| tree | aa37852acd83ffd38d00ec65285665bec68c7f12 /test/TestUtils.hs | |
| parent | 2d9588f5b309aa6b5114d8719bfe3d0b17abbcff (diff) | |
Add shadowing symbol error
Diffstat (limited to 'test/TestUtils.hs')
| -rw-r--r-- | test/TestUtils.hs | 19 |
1 files changed, 15 insertions, 4 deletions
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 |
