implemented simple evaluator for program,

statements and integer literals, together with
tests
This commit is contained in:
Karma Riuk
2025-07-19 15:03:38 +02:00
parent 7b01840f4d
commit 47379c6635
9 changed files with 105 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#include "doctest.h"
#include "utils.hpp"
TEST_SUITE("Eval: integers") {
TEST_CASE_FIXTURE(
test::utils::EvalFixture,
"Simple integer expression statements"
) {
struct test_struct {
std::string input;
int expected;
};
struct test_struct tests[]{{"5", 5}, {"10", 10}};
for (auto& t : tests) {
setup(t.input);
test::utils::test_integer_object(result.get(), t.expected);
}
}
}