Example #1
0
def test_day06_part1():
    assert day06.part1('''COM)B
B)C
C)D
D)E
E)F
B)G
G)H
D)I
E)J
J)K
K)L'''.split()) == 42
    assert day06.part1(open('input06.txt')) == 171213
Example #2
0
def test_part1():
    solar_system = [
        'COM)B', 'B)C', 'C)D', 'D)E', 'E)F', 'B)G', 'G)H', 'D)I', 'E)J', 'J)K',
        'K)L'
    ]
    answer = 42
    assert day06.part1(solar_system) == answer
Example #3
0
def test_part1_alternate_ordering():
    solar_system = [
        'K)L', 'J)K', 'E)J', 'D)I', 'G)H', 'B)G', 'E)F', 'D)E', 'C)D', 'B)C',
        'COM)B'
    ]
    answer = 42
    assert day06.part1(solar_system) == answer
Example #4
0
    def test_part1_example(self):
        input_list = [
            "COM)B",
            "B)C",
            "C)D",
            "D)E",
            "E)F",
            "B)G",
            "G)H",
            "D)I",
            "E)J",
            "J)K",
            "K)L",
        ]

        result = day06.part1(input_list)
        self.assertEqual(42, result)
Example #5
0
def test_part1_sample(sample_data):
    assert part1(sample_data) == 11
Example #6
0
def test_part1(tree, combined_depths):
    d = parse_tree(tree.split())
    combined_depths == part1(d["E"].root)
Example #7
0
def test_part1(puzzle_input, answer):
    assert part1(puzzle_input) == answer
Example #8
0
def test_part1():
    assert day06.part1('input_day06.txt') == 241064
Example #9
0
 def test_part1_input(self):
     result = day06.part1(aoc.read_input('day06.input'))
     self.assertEqual(273985, result)
Example #10
0
def test_day06_part1():
    assert day06.part1(day06_example) == 11
Example #11
0
 def test_part1_on_example_data(self):
     input = read_inputfile("example06.txt")
     self.assertEqual(day06.part1(input), 11)
def test_6_1_examples():
    examples = []
    for (inp, out) in examples:
        assert out == day06.part1(inp)
Example #13
0
 def test_part1_example1(self):
     result = day06.part1(self.example)
     self.assertEqual(result, 17)
Example #14
0
def test_part1():
    assert part1("day06/day06.dat") == 3449