Exemplo n.º 1
0
    def test_part_one(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_one(input, 10) == 179

        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_one(input, 100) == 1940
Exemplo n.º 2
0
def test_part_one(puzzle_input: str, expected: int):
    instructions = [(line[0], int(line[1:])) for line in puzzle_input.split()]

    assert expected == part_one(instructions)
Exemplo n.º 3
0
 def test_part_1_known_input(self):
     self.assertEqual(25, part_one(get_input_lines("test_input.txt")))
Exemplo n.º 4
0
 def test_p1_simple_list(self):
     self.assertEqual(day12.part_one('[1,2,3]'), 6)
Exemplo n.º 5
0
 def test_day_twelve(self):
     input = download_input(12)
     assert day12.part_one(input) == 7013
     assert day12.part_two(input) == 324618307124784
Exemplo n.º 6
0
 def test_p1_empty_list(self):
     self.assertEqual(day12.part_one('[]'), 0)
Exemplo n.º 7
0
 def test_p1_empty_map(self):
     self.assertEqual(day12.part_one('{}'), 0)
Exemplo n.º 8
0
 def test_p1_negative_in_map(self):
     self.assertEqual(day12.part_one('[-1,{"a":1}]'), 0)
Exemplo n.º 9
0
 def test_p1_negative_in_list(self):
     self.assertEqual(day12.part_one('{"a":[-1,1]}'), 0)
Exemplo n.º 10
0
 def test_p1_nested_map(self):
     self.assertEqual(day12.part_one('{"a":{"b":4},"c":-1}'), 3)
Exemplo n.º 11
0
 def test_p1_nested_list(self):
     self.assertEqual(day12.part_one('[[[3]]]'), 3)
Exemplo n.º 12
0
 def test_p1_map(self):
     self.assertEqual(day12.part_one('{"a":2, "b":4}'), 6)