summaryrefslogtreecommitdiff
path: root/tiger-compiler/tests/unit/parse/tiger_factory/test_make_string_exp.cc
blob: 2b898b0fc1ae7403e32b6fb353e0947319c95f76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#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(BasicStr);

Test(BasicStr, SimpleStr)
{
    std::cout << "----- BaseTyRec -----";
    ast::PrettyPrinter print(std::cout);
    ast::Exp* test = parse::parse("Screw gravity!");
    cr_assert_not_null(test);
    print(test);
    cr_assert_eq(1, 1);
}

TestSuite(RealisticStr);

Test(RealisticStr, Escapes)
{
    ast::PrettyPrinter print(std::cout);
    ast::Exp* test = parse::parse("Something's wrong \\\"\n, I can feel it...\r");
    cr_assert_not_null(test);
    print(test);
    cr_assert_eq(1, 1);
}