summaryrefslogtreecommitdiff
path: root/tiger-compiler/tests/unit/parse/tiger_factory/test_make_field_var.cc
blob: 1d85afac5a85f72252af3b3ce6285970ddcdc9dd (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(BasicVar);

Test(BasicVar, SimpleVar)
{
    std::cout << "----- BaseVars -----";
    ast::PrettyPrinter print(std::cout);
    ast::Exp* test = parse::parse("var test := \"Code harder, not smarter\"");
    cr_assert_not_null(test);
    print(test);
    cr_assert_eq(1, 1);
}

TestSuite(RealisticVar);

Test(RealisticVar, Var_WExprs)
{
    ast::PrettyPrinter print(std::cout);
    ast::Exp* test = parse::parse("var test : int := 3 + 6 + 9");
    cr_assert_not_null(test);
    print(test);
    cr_assert_eq(1, 1);
}