def test_day18_part1(): assert day18.part1('''######### #[email protected]# #########''') == 8 assert day18.part1('''######################## #[email protected].# ######################.# #d.....................# ########################''') == 86 assert day18.part1('''######################## #...............b.C.D.f# #.###################### #[email protected]# ########################''') == 132 assert day18.part1('''################# #i.G..c...e..H.p# ########.######## #j.A..b...f..D.o# ########@######## #k.E..a...g..B.n# ########.######## #l.F..d...h..C.m# #################''') == 136 assert day18.part1('''######################## #@..............ac.GI.b# ###d#e#f################ ###A#B#C################ ###g#h#i################ ########################''') == 81
def test_part1_example1(self): content = dedent(""" ######### #[email protected]# ######### """) grid, starting_point = parse(content) self.assertEqual(part1(grid, starting_point), 8)
def test_part1_exampe1(self): example_input = [ "#########", "#[email protected]#", "#########", ] result = day18.part1(example_input) self.assertEqual(8, result)
def test_part1_example3(self): content = dedent(""" ######################## #...............b.C.D.f# #.###################### #[email protected]# ######################## """) grid, starting_point = parse(content) self.assertEqual(part1(grid, starting_point), 132)
def test_part1_example2(self): content = dedent(""" ######################## #[email protected].# ######################.# #d.....................# ######################## """) grid, starting_point = parse(content) self.assertEqual(part1(grid, starting_point), 86)
def test_part1_example2(self): example_input = [ "########################", "#[email protected].#", "######################.#", "#d.....................#", "########################", ] result = day18.part1(example_input) self.assertEqual(86, result)
def test_part1_example3(self): example_input = [ "########################", "#...............b.C.D.f#", "#.######################", "#[email protected]#", "########################", ] result = day18.part1(example_input) self.assertEqual(132, result)
def test_part1_example5(self): example_input = [ "########################", "#@..............ac.GI.b#", "###d#e#f################", "###A#B#C################", "###g#h#i################", "########################", ] result = day18.part1(example_input) self.assertEqual(81, result)
def test_part1_example5(self): content = dedent(""" ######################## #@..............ac.GI.b# ###d#e#f################ ###A#B#C################ ###g#h#i################ ######################## """) grid, starting_point = parse(content) self.assertEqual(part1(grid, starting_point), 81)
def test_part1_example4(self): content = dedent(""" ################# #i.G..c...e..H.p# ########.######## #j.A..b...f..D.o# ########@######## #k.E..a...g..B.n# ########.######## #l.F..d...h..C.m# ################# """) grid, starting_point = parse(content) self.assertEqual(part1(grid, starting_point), 136)
def test_part1_example4(self): example_input = [ "#################", "#i.G..c...e..H.p#", "########.########", "#j.A..b...f..D.o#", "########@########", "#k.E..a...g..B.n#", "########.########", "#l.F..d...h..C.m#", "#################", ] result = day18.part1(example_input) self.assertEqual(136, result)
def test_part1(puzzle_input, answer): assert part1(puzzle_input) == answer
def test_part1_input(self): result = day18.part1(aoc.read_input('day18.input')) self.assertEqual(5964, result)
def test_part1_input(input_data): assert part1(input_data) == 701339185745
def test_day18_part1(expression, value): assert day18.part1(expression) == value
def test_part1_example(self): result = day18.part1(self.example_input) self.assertEqual(1147, result)
def test_18_1_examples(): examples = [] for (inp, out) in examples: assert out == day18.part1(inp)