aboutsummaryrefslogtreecommitdiffstats
path: root/test/TestUtils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'test/TestUtils.hs')
-rw-r--r--test/TestUtils.hs19
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