created the parser dir test to avoid having a
bunch of "unrelated" tests in one file
This commit is contained in:
15
test/parser/utils.cpp
Normal file
15
test/parser/utils.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "utils.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
void check_parser_errors(const std::vector<ast::error::error*>& errors) {
|
||||
if (errors.empty())
|
||||
return;
|
||||
|
||||
std::cerr << "parser has " << errors.size() << " errors:\n";
|
||||
for (const auto& error : errors)
|
||||
std::cerr << '\t' << error->what() << "\n";
|
||||
|
||||
// Use doctest's FAIL macro to immediately stop
|
||||
FAIL_CHECK("Parser had errors. See stderr for details.");
|
||||
}
|
Reference in New Issue
Block a user