Пример #1
0
    def test_part_two(self):
        input = [
            "<x=-1, y=0, z=2>", "<x=2, y=-10, z=-7>", "<x=4, y=-8, z=8>",
            "<x=3, y=5, z=-1>"
        ]
        assert part_two(input) == 2772

        input = [
            "<x=-8, y=-10, z=0>", "<x=5, y=5, z=10>", "<x=2, y=-7, z=3>",
            "<x=9, y=-8, z=-3>"
        ]
        assert part_two(input) == 4686774924
Пример #2
0
def test_part_two(puzzle_input: str, expected: int):
    instructions = [(line[0], int(line[1:])) for line in puzzle_input.split()]

    assert expected == part_two(instructions)
Пример #3
0
 def test_part_2_known_input(self):
     self.assertEqual(286, part_two(get_input_lines("test_input.txt")))
Пример #4
0
 def test_day_twelve(self):
     input = download_input(12)
     assert day12.part_one(input) == 7013
     assert day12.part_two(input) == 324618307124784
Пример #5
0
 def test_p2_no_ignore_array(self):
     self.assertEqual(day12.part_two('[1,"red",5]'), 6)
Пример #6
0
 def test_p2_ignore_all(self):
     self.assertEqual(day12.part_two('{"d":"red","e":[1,2,3,4],"f":5}'), 0)
Пример #7
0
 def test_p2_ignore_map(self):
     self.assertEqual(day12.part_two('[1, {"c":"red", "b":2}, 3]'), 4)
Пример #8
0
 def test_p2_simple_list(self):
     self.assertEqual(day12.part_two('[1,2,3]'), 6)