Пример #1
0
def test_day03_part1():
    assert day03.part1(['R8,U5,L5,D3', 'U7,R6,D4,L4']) == 6
    assert day03.part1([
        'R75,D30,R83,U83,L12,D49,R71,U7,L72', 'U62,R66,U55,R34,D71,R55,D58,R83'
    ]) == 159
    assert day03.part1([
        'R98,U47,R26,D63,R33,U87,L62,D20,R33,U53,R51',
        'U98,R91,D20,R16,D67,R40,U7,R15,U6,R7'
    ]) == 135
Пример #2
0
 def test_part1_example2(self):
     input_list = [
         "R75,D30,R83,U83,L12,D49,R71,U7,L72",
         "U62,R66,U55,R34,D71,R55,D58,R83"
     ]
     result = day03.part1(input_list)
     self.assertEqual(159, result)
Пример #3
0
 def test_part1_example3(self):
     input_list = [
         "R98,U47,R26,D63,R33,U87,L62,D20,R33,U53,R51",
         "U98,R91,D20,R16,D67,R40,U7,R15,U6,R7"
     ]
     result = day03.part1(input_list)
     self.assertEqual(135, result)
def test_part1_c():
    first_path = [
        'R98', 'U47', 'R26', 'D63', 'R33', 'U87', 'L62', 'D20', 'R33', 'U53',
        'R51'
    ]
    second_path = [
        'U98', 'R91', 'D20', 'R16', 'D67', 'R40', 'U7', 'R15', 'U6', 'R7'
    ]
    answer = 135
    assert day03.part1(first_path, second_path) == answer
Пример #5
0
def test_part1():
    assert part1(TEST) == 198
Пример #6
0
def test_part1():
    assert day03.part1('input_day03.txt') == 529
Пример #7
0
def test_part1_sample(sample_map):
    assert part1(sample_map) == 7
Пример #8
0
def test_part1():
    assert part1(289326) == 419
def test_part_1_sample(sample_data):
    assert part1(sample_data) == 198
Пример #10
0
 def test_part1_input(self):
     result = day03.part1(aoc.read_input('day03.input'))
     self.assertEqual(293, result)
Пример #11
0
def test_part1(puzzle_input, answer):
    assert part1(puzzle_input) == answer
Пример #12
0
def test_part1():
    assert part1("day03/day03.dat") == 109716
Пример #13
0
def test_part1(c1, c2, result):
    assert result == part1(c1, c2)
def test_part1_a():
    first_path = ['R8', 'U5', 'L5', 'D3']
    second_path = ['U7', 'R6', 'D4', 'L4']
    answer = 6
    assert day03.part1(first_path, second_path) == answer
def test_part1_b():
    first_path = ['R75', 'D30', 'R83', 'U83', 'L12', 'D49', 'R71', 'U7', 'L72']
    second_path = ['U62', 'R66', 'U55', 'R34', 'D71', 'R55', 'D58', 'R83']
    answer = 159
    assert day03.part1(first_path, second_path) == answer
Пример #16
0
def test_part_1(input_data):
    assert part1(input_data) == 2595824
Пример #17
0
def test_3_1_examples():
    examples = []
    for (inp, out) in examples:
        assert out == day03.part1(inp)
Пример #18
0
def test_day03_part1():
    assert day03.part1(day03_testmap) == 7
Пример #19
0
 def test_part1_example1(self):
     input_list = ["R8,U5,L5,D3", "U7,R6,D4,L4"]
     result = day03.part1(input_list)
     self.assertEqual(6, result)
Пример #20
0
 def test_part1_example1(self):
     result = day03.part1(self.example)
     self.assertEqual(result, 4)