Пример #1
0
def test_day07_part2():
    day07.part2(
        '3,26,1001,26,-4,26,3,27,1002,27,2,27,1,27,26,27,4,27,1001,28,-1,28,1005,28,6,99,0,0,5'
    ) == 139629729
    day07.part2(
        '3,52,1001,52,-5,52,3,53,1,52,56,54,1007,54,5,55,1005,55,26,1001,54,-5,54,1105,1,12,1,53,54,53,1008,54,0,55,1001,55,1,55,2,53,55,53,4,53,1001,56,-1,56,1005,56,6,99,0,0,0,0,10'
    ) == 18216
Пример #2
0
    def test_part2_example1(self):
        input_list = [
            "3,26,1001,26,-4,26,3,27,1002,27,2,27,1,27,26,"
            "27,4,27,1001,28,-1,28,1005,28,6,99,0,0,5"
        ]

        result = day07.part2(input_list)
        self.assertEqual(139629729, result)
Пример #3
0
    def test_part2_example2(self):
        input_list = [
            "3,52,1001,52,-5,52,3,53,1,52,56,54,1007,54,5,55,1005,55,26,1001,54,"
            "-5,54,1105,1,12,1,53,54,53,1008,54,0,55,1001,55,1,55,2,53,55,53,4,"
            "53,1001,56,-1,56,1005,56,6,99,0,0,0,0,10"
        ]

        result = day07.part2(input_list)
        self.assertEqual(18216, result)
Пример #4
0
 def test_part2_input(self):
     result = day07.part2(aoc.read_input('day07.input'))
     self.assertEqual(result, 1024)
Пример #5
0
def test_part2_sample2(sample2_data):
    assert part2(sample2_data) == 126
Пример #6
0
def test_part2_sample(sample_data):
    assert part2(sample_data) == 32
Пример #7
0
def test_part2():
    assert part2("day07/day07.dat", num_workers=5) == 1226
Пример #8
0
def test_day07_part2_answer():
    assert day07.part2(open('input07.txt').read()) == 54803
Пример #9
0
def test_day07_part2_2():
    assert day07.part2(day07_example_2) == 126
Пример #10
0
def test_day07_part2_1():
    assert day07.part2(day07_example) == 32
Пример #11
0
def test_7_2_examples():
    examples = []
    for (inp, out) in examples:
        assert out == day07.part2(inp)
Пример #12
0
def test_part2(puzzle_input, answer):
    assert part2(puzzle_input) == answer
Пример #13
0
 def test_regressions(self):
     self.assertEqual(17790, part1())
     self.assertEqual(19384820, part2())
Пример #14
0
 def test_part2_input(self):
     result = day07.part2(aoc.read_input('day07.input'))
     self.assertEqual(1714298, result)
Пример #15
0
def test_part2_final_result():
    with open("day07_input.txt") as f:
        original_tape = [int(x) for x in f.readline().split(",")]
    t = list_to_defaultdict(original_tape)
    assert part2(t) == 17519904
Пример #16
0
def test_part2_params(tape, result):
    t = list_to_defaultdict(tape)
    assert part2(t) == result