implemented simple evaluator for program,
statements and integer literals, together with tests
This commit is contained in:
10
test/utils/test_eval.cpp
Normal file
10
test/utils/test_eval.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "object/integers.hpp"
|
||||
#include "object/object.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
namespace test::utils {
|
||||
void test_integer_object(object::object* obj, int expected) {
|
||||
object::integer* i = cast<object::integer>(obj);
|
||||
CHECK(i->value == expected);
|
||||
}
|
||||
} // namespace test::utils
|
Reference in New Issue
Block a user