Add TestContext::runPart1() for tests that are only valid for part 1 of a puzzle
This commit is contained in:
		
							parent
							
								
									047abf9772
								
							
						
					
					
						commit
						8e67c19f98
					
				| @ -26,6 +26,8 @@ class TestContext | ||||
| public: | ||||
|     void run(const std::unique_ptr<Solver>&& solver, const long long int expected1, const long long int expected2, | ||||
|         const std::vector<std::string>& inputPaths); | ||||
|     void runPart1(const std::unique_ptr<Solver>&& solver, const long long int expected, | ||||
|         const std::vector<std::string>& inputPaths); | ||||
|     void runPart2(const std::unique_ptr<Solver>&& solver, const long long int expected, | ||||
|         const std::vector<std::string>& inputPaths); | ||||
|     std::vector<std::string> getInputPaths() const; | ||||
|  | ||||
| @ -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) | ||||
| { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user