summaryrefslogtreecommitdiff
path: root/tiger-compiler/tests/unit/parse/tiger_factory/test_make_call_exp.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/tiger_factory/test_make_call_exp.cc
add: added projectsHEADmain
Diffstat (limited to 'tiger-compiler/tests/unit/parse/tiger_factory/test_make_call_exp.cc')
-rw-r--r--tiger-compiler/tests/unit/parse/tiger_factory/test_make_call_exp.cc41
1 files changed, 41 insertions, 0 deletions
diff --git a/tiger-compiler/tests/unit/parse/tiger_factory/test_make_call_exp.cc b/tiger-compiler/tests/unit/parse/tiger_factory/test_make_call_exp.cc
new file mode 100644
index 0000000..5c4b9bb
--- /dev/null
+++ b/tiger-compiler/tests/unit/parse/tiger_factory/test_make_call_exp.cc
@@ -0,0 +1,41 @@
+#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>
+
+TestSuite(BasicCall);
+
+Test(BasicCall, SimpleCall)
+{
+ std::cout << "----- FunCall -----";
+ ast::PrettyPrinter print(std::cout);
+ ast::Exp* test = parse::parse("let "
+ " function test(a : int, b : string) : int = "
+ " a "
+ " in "
+ " test(1, \"2M, 22H->H, f.L, RS, RC, 55M, 632146M\") "
+ " end \n");
+ cr_assert_not_null(test);
+ print(test);
+ cr_assert_eq(1, 1);
+}
+
+TestSuite(RealisticCall);
+
+Test(RealisticCall, Call_WExprs)
+{
+ ast::PrettyPrinter print(std::cout);
+ // If someone get this and sends me a video proof, you have my utmost respect (the sequence in itself is not that hard tbh)
+ ast::Exp* test = parse::parse("let "
+ " function test(a : int, b : string) : int = "
+ " a "
+ " in "
+ " test(1 + 2 + c + inexistant, \"2M, 22H->H, f.L, RS, RC, 55M, 632146M\")"
+ " end \n");
+ cr_assert_not_null(test);
+ print(test);
+ cr_assert_eq(1, 1);
+}