Add TestContext::runPart2 for tests that are only valid for part 2 of a puzzle

This commit is contained in:
2025-02-17 15:23:05 +01:00
parent ce77b2354c
commit f3682a46a9
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::runPart2(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->getResultPart2());
}
std::vector<std::string> TestContext::getInputPaths() const
{
return std::vector<std::string>{ "data", "../../../data", "../../../../data" };