using smart pointers instead of normal ones for

easier setup of tests (to call setup() multiple
times without leaks)
This commit is contained in:
Karma Riuk
2025-07-11 11:16:16 +02:00
parent 826f4de77a
commit 2174781b77
7 changed files with 14 additions and 18 deletions

View File

@@ -52,13 +52,11 @@ T* cast(ast::error::error* err) {
struct ParserFixture {
std::stringstream input;
lexer::lexer* lexer = nullptr;
parser::parser* parser = nullptr;
ast::program* program = nullptr;
std::unique_ptr<lexer::lexer> lexer;
std::unique_ptr<parser::parser> parser;
std::unique_ptr<ast::program> program;
ParserFixture() = default;
void setup(std::string);
~ParserFixture();
};