Пример #1
0
    def test_part1_example3(self):
        input_list = [
            "3,31,3,32,1002,32,10,32,1001,31,-2,31,1007,31,0,33,"
            "1002,33,7,33,1,33,31,31,1,32,31,31,4,31,99,0,0,0"
        ]

        result = day07.part1(input_list)
        self.assertEqual(65210, result)
Пример #2
0
    def test_part1_example2(self):
        input_list = [
            "3, 23, 3, 24, 1002, 24, 10, 24, 1002, 23, -1, 23, 101, 5, 23, 23, 1, 24, 23, 23, 4,"
            "23, 99, 0, 0"
        ]

        result = day07.part1(input_list)
        self.assertEqual(54321, result)
Пример #3
0
def test_day07_part1():
    day07.part1('3,15,3,16,1002,16,10,16,1,16,15,15,4,15,99,0,0') == 43210
    day07.part1(
        '3,23,3,24,1002,24,10,24,1002,23,-1,23,101,5,23,23,1,24,23,23,4,23,99,0,0'
    ) == 54321
    day07.part1(
        '3,31,3,32,1002,32,10,32,1001,31,-2,31,1007,31,0,33,1002,33,7,33,1,33,31,31,1,32,31,31,4,31,99,0,0,0'
    ) == 65210
Пример #4
0
def test_part1_sample(sample_data):
    assert part1(sample_data) == 4
Пример #5
0
def test_part1():
    assert part1("day07/day07.dat") == "HEGMPOAWBFCDITVXYZRKUQNSLJ"
    pass
Пример #6
0
def test_part1():
    assert part1() == 'mkxke'
Пример #7
0
def test_part1():
    assert day07.part1('input_day07.txt') == 437860
Пример #8
0
def test_day07_part1_answer():
    assert day07.part1(open('input07.txt').read()) == 155
Пример #9
0
def test_part1_final_result():
    with open("day07_input.txt") as f:
        original_tape = [int(x) for x in f.readline().split(",")]
    assert part1(original_tape) == 199988
Пример #10
0
def test_7_1_examples():
    examples = []
    for (inp, out) in examples:
        assert out == day07.part1(inp)
Пример #11
0
def test_part1(puzzle_input, answer):
    assert part1(puzzle_input) == answer
Пример #12
0
 def test_regressions(self):
     self.assertEqual(17790, part1())
     self.assertEqual(19384820, part2())
Пример #13
0
    def test_part1_example1(self):
        input_list = ["3,15,3,16,1002,16,10,16,1,16,15,15,4,15,99,0,0"]

        result = day07.part1(input_list)
        self.assertEqual(43210, result)
Пример #14
0
 def test_part1_input(self):
     result = day07.part1(aoc.read_input('day07.input'))
     self.assertEqual(11828, result)
Пример #15
0
 def test_part1_example1(self):
     result = day07.part1(self.example)
     self.assertEqual(result, 'CABDFE')
Пример #16
0
def test_day07_part1():
    assert day07.part1(day07_example) == 4
Пример #17
0
 def test_part1_input(self):
     result = day07.part1(aoc.read_input('day07.input'))
     self.assertEqual(result, 'GDHOSUXACIMRTPWNYJLEQFVZBK')
Пример #18
0
def test_part1_params(tape, result):
    t = list_to_defaultdict(tape)
    assert part1(t) == result