def test_part2(self): s = "17,x,13,19" self.assertEqual(part2(s), 3417) s = "67,7,59,61" self.assertEqual(part2(s), 754018) s = "67,x,7,59,61" self.assertEqual(part2(s), 779210) s = "67,7,x,59,61" self.assertEqual(part2(s), 1261476) s = "1789,37,47,1889" self.assertEqual(part2(s), 1202161486)
def test_part2_example(self): self.assertEqual( 1068781, day13.part2("939\n7,13,x,x,59,x,31,19"), )
def test_part2_on_example_data(self): input = read_inputfile("example13.txt") self.assertEqual(part2(input[1]), 1068781)
def test_part2(input_file, data, expect): with open("input", "w") as f: f.write('1\n') f.write(data + '\n') assert part2() == expect
def test_part2_input(self): result = day13.part2(aoc.read_input('day13.input')) self.assertEqual(18509, result)
def test_part2_input(input_data): assert part2(input_data) == 840493039281088
def test_part2_2(): bus_ids_2 = ["67", "7", "59", "61"] assert part2(bus_ids_2, start=100) == 754018
def test_part2_4(): bus_ids_4 = ["67", "7", "x", "59", "61"] assert part2(bus_ids_4, start=100) == 1261476
def test_part2_5(): bus_ids_5 = ["1789", "37", "47", "1889"] assert part2(bus_ids_5, start=100) == 1202161486
def test_day13_part2(data, expected): assert day13.part2(data) == expected
def test_part2_3(): bus_ids_3 = ["67", "x", "7", "59", "61"] assert part2(bus_ids_3, start=100) == 779210
def test_part2(): assert part2() == 12099
def test_13_2_examples(): examples = [] for (inp, out) in examples: assert out == day13.part2(inp)
def test_part2_sample(sample_data): assert part2(sample_data) == 1068781
def test_part2_long(self): self.assertEqual(1202161486, day13.part2("0\n1789,37,47,1889"))
def test_part2_1(): bus_ids_1 = ["17", "x", "13", "19"] assert part2(bus_ids_1, start=100) == 3417
def test_part2(self): with open("../inputs/day13.txt") as in_file: self.assertEqual(247086664214628, day13.part2(in_file.read()))
def test_part2(self): self.assertEqual(294354277694107, part2())