diff options
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.cc | 41 |
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); +} |
