예제 #1
0
 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)
예제 #2
0
 def test_part2_example(self):
     self.assertEqual(
         1068781,
         day13.part2("939\n7,13,x,x,59,x,31,19"),
     )
예제 #3
0
 def test_part2_on_example_data(self):
     input = read_inputfile("example13.txt")
     self.assertEqual(part2(input[1]), 1068781)
예제 #4
0
def test_part2(input_file, data, expect):
    with open("input", "w") as f:
        f.write('1\n')
        f.write(data + '\n')

    assert part2() == expect
예제 #5
0
 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
예제 #7
0
def test_part2_2():
    bus_ids_2 = ["67", "7", "59", "61"]
    assert part2(bus_ids_2, start=100) == 754018
예제 #8
0
def test_part2_4():
    bus_ids_4 = ["67", "7", "x", "59", "61"]
    assert part2(bus_ids_4, start=100) == 1261476
예제 #9
0
def test_part2_5():
    bus_ids_5 = ["1789", "37", "47", "1889"]
    assert part2(bus_ids_5, start=100) == 1202161486
예제 #10
0
def test_day13_part2(data, expected):
    assert day13.part2(data) == expected
예제 #11
0
def test_part2_3():
    bus_ids_3 = ["67", "x", "7", "59", "61"]
    assert part2(bus_ids_3, start=100) == 779210
예제 #12
0
def test_part2():
    assert part2() == 12099
예제 #13
0
def test_13_2_examples():
    examples = []
    for (inp, out) in examples:
        assert out == day13.part2(inp)
예제 #14
0
def test_part2_sample(sample_data):
    assert part2(sample_data) == 1068781
예제 #15
0
 def test_part2_long(self):
     self.assertEqual(1202161486, day13.part2("0\n1789,37,47,1889"))
예제 #16
0
def test_part2_1():
    bus_ids_1 = ["17", "x", "13", "19"]
    assert part2(bus_ids_1, start=100) == 3417
예제 #17
0
 def test_part2(self):
     with open("../inputs/day13.txt") as in_file:
         self.assertEqual(247086664214628, day13.part2(in_file.read()))
예제 #18
0
 def test_part2(self):
     self.assertEqual(294354277694107, part2())