advent-of-code/2017-python/tests/day_22_tests.py

32 lines
742 B
Python
Raw Normal View History

2021-11-01 16:40:46 +01:00
import unittest
from solutions.day_22 import Solution
class Day22TestCase(unittest.TestCase):
def setUp(self):
self.solution = Solution()
def test_infected(self):
puzzle_input = """
..#
#..
...
"""
assert self.solution.solve(puzzle_input, 7) == 5
assert self.solution.solve(puzzle_input, 70) == 41
assert self.solution.solve(puzzle_input, 10000) == 5587
def test_evolved_infected(self):
puzzle_input = """
..#
#..
...
"""
assert self.solution.solve_again(puzzle_input, 100) == 26
assert self.solution.solve_again(puzzle_input, 10000000) == 2511944
2025-05-06 20:14:58 +02:00
if __name__ == "__main__":
2021-11-01 16:40:46 +01:00
unittest.main()