better use of fixtures for resource allocation and
dealocation
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
#include "ast/ast.hpp"
|
||||
#include "parser/parser.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
#include <doctest.h>
|
||||
@@ -12,13 +10,6 @@ return 10;\
|
||||
return 103213;\
|
||||
");
|
||||
|
||||
ast::program* program = p->parse_program();
|
||||
check_parser_errors(p->errors);
|
||||
|
||||
REQUIRE_MESSAGE(
|
||||
program != nullptr,
|
||||
"parse_program() returned a null pointer"
|
||||
);
|
||||
REQUIRE(program->statements.size() == 3);
|
||||
|
||||
for (const auto stmt : program->statements) {
|
||||
@@ -30,7 +21,5 @@ return 103213;\
|
||||
"Couldn't cast statement to a return statement"
|
||||
);
|
||||
}
|
||||
|
||||
delete program;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user