extracted to a function the casting of the
different types to make tests cleaner
This commit is contained in:
@@ -14,12 +14,7 @@ return 103213;\
|
||||
|
||||
for (const auto stmt : program->statements) {
|
||||
REQUIRE(stmt->token_literal() == "return");
|
||||
ast::return_stmt* let_stmt;
|
||||
REQUIRE_NOTHROW(let_stmt = dynamic_cast<ast::return_stmt*>(stmt));
|
||||
REQUIRE_MESSAGE(
|
||||
let_stmt != nullptr,
|
||||
"Couldn't cast statement to a return statement"
|
||||
);
|
||||
ast::return_stmt* return_stmt = cast<ast::return_stmt>(stmt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user