summaryrefslogtreecommitdiff
path: root/tiger-compiler/tests/unit/parse/test_hello.cc
diff options
context:
space:
mode:
authorMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:07:58 +0200
committerMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:07:58 +0200
commit967be9e750221ab2ab783f95df79bb26d290a45e (patch)
tree6802900a5e975f9f68b169f0f503f040056d6952 /tiger-compiler/tests/unit/parse/test_hello.cc
add: added projectsHEADmain
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);
+}