created the parser dir test to avoid having a

bunch of "unrelated" tests in one file
This commit is contained in:
Karma Riuk
2025-07-07 17:20:21 +02:00
parent 132dc65240
commit 7b916b2a0b
3 changed files with 24 additions and 15 deletions

15
test/parser/utils.cpp Normal file
View 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.");
}