示例#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)