1 #ifndef INTERPRETER_SUITE_H_
2 #define INTERPRETER_SUITE_H_
5 #include "script/builtins.h"
11 struct Expr nil1 = NIL(gc);
12 struct Expr nil2 = NIL(gc);
13 ASSERT_TRUE(equal(nil1, nil2), "nils are not equal");
16 CONS(gc, SYMBOL(gc, "a"),
17 CONS(gc, SYMBOL(gc, "b"),
18 CONS(gc, SYMBOL(gc, "c"),
21 CONS(gc, SYMBOL(gc, "a"),
22 CONS(gc, SYMBOL(gc, "b"),
23 CONS(gc, SYMBOL(gc, "c"),
25 ASSERT_TRUE(equal(list1, list2), "lists are not equal");
36 struct Expr nil = NIL(gc);
38 struct Expr a = SYMBOL(gc, "a");
39 struct Expr b = SYMBOL(gc, "b");
40 struct Expr c = SYMBOL(gc, "c");
42 struct Expr a_pair = CONS(gc, a, NUMBER(gc, 10.0f));
43 struct Expr b_pair = CONS(gc, b, NUMBER(gc, 20.0f));
44 struct Expr c_pair = CONS(gc, c, NUMBER(gc, 30.0f));
49 CONS(gc, c_pair, nil)));
51 ASSERT_TRUE(equal(a_pair, assoc(a, alist)), "unexpected pair retrieved");
58 TEST_SUITE(interpreter_suite)
66 #endif // INTERPRETER_SUITE_H_