summaryrefslogtreecommitdiff
path: root/tiger-compiler/tests/unit/parse/test_hello.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tiger-compiler/tests/unit/parse/test_hello.cc')
-rw-r--r--tiger-compiler/tests/unit/parse/test_hello.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/tiger-compiler/tests/unit/parse/test_hello.cc b/tiger-compiler/tests/unit/parse/test_hello.cc
new file mode 100644
index 0000000..5828ca2
--- /dev/null
+++ b/tiger-compiler/tests/unit/parse/test_hello.cc
@@ -0,0 +1,36 @@
+#include <ast/exp.hh>
+#include <ast/libast.hh>
+#include <criterion/criterion.h>
+#include <criterion/assert.h>
+#include <parse/libparse.hh>
+#include <ast/fwd.hh>
+#include <ast/pretty-printer.hh>
+
+Test(Basic, SimpleBody)
+{
+ std::cout << "----- basicTests -----";
+ ast::PrettyPrinter print(std::cout);
+ ast::Exp* boiiiiiii = parse::parse("let "
+ " var i := 3 "
+ " in "
+ " i + 1 "
+ " end");
+ cr_assert_not_null(boiiiiiii);
+ print(boiiiiiii);
+ cr_assert_eq(1, 1);
+}
+
+Test(Basic, ChunkList)
+{
+ ast::PrettyPrinter print(std::cout);
+ ast::Exp* test = parse::parse("let "
+ " var i := 1 "
+ " var j := 2 "
+ " var k := 3 "
+ " in "
+ " i + j + k "
+ " end");
+ cr_assert_not_null(test);
+ print(test);
+ cr_assert_eq(1, 1);
+}