Add TestContext::runPart1() for tests that are only valid for part 1 of a puzzle

This commit is contained in:
2025-03-09 16:00:19 +01:00
parent 047abf9772
commit 8e67c19f98
2 changed files with 11 additions and 0 deletions

View File

@@ -29,6 +29,15 @@ void TestContext::run(const std::unique_ptr<Solver>&& solver, const long long in
REQUIRE(expected2 == solver->getResultPart2());
}
void TestContext::runPart1(const std::unique_ptr<Solver>&& solver, const long long int expected,
const std::vector<std::string>& inputPaths)
{
SolverEngine solverEngine{ inputPaths };
solverEngine.run(*solver);
REQUIRE(expected == solver->getResultPart1());
}
void TestContext::runPart2(const std::unique_ptr<Solver>&& solver, const long long int expected,
const std::vector<std::string>& inputPaths)
{