예제 #1
0
def test_part_two():
    graph = load_data("test_input.txt")
    for node_name, node in graph.nodes.items():
        print(node_name, node.out_edges)
    assert part_two(graph) == 32

    graph = load_data("test_input2.txt")
    for node_name, node in graph.nodes.items():
        print(node_name, node.out_edges)
    assert part_two(graph) == 126
예제 #2
0
def test_part_two():
    tiles = [
        Tile(int(lines[0].split()[1][:-1]), lines[1:])
        for lines in load_data('test_input.txt')
    ]
    tiles = arrange_tiles(tiles)
    assert part_two(tiles) == 273
예제 #3
0
def test_part_two():
    examples = {
        '1212' : 6,
        '1221' : 0,
        '123425' : 4,
        '123123' : 12,
        '12131415' : 4
    }
    for elem in examples:
        assert s.part_two(elem) == examples[elem]
def test_part_two():
    examples = {
        '<>': 0,
        '<random characters>': 17,
        '<<<<>': 3,
        '<{!>}>': 2,
        '<!!>': 0,
        '<!!!>>': 0,
        '<{o"i!a,<{i<a>': 10
    }
    for elem in examples:
        assert s.part_two(elem) == examples[elem]
예제 #5
0
def test_part_two():
    assert part_two(load_data("test_input.txt")) == 8
    assert part_two(load_data("test_input2.txt")) == 19208
예제 #6
0
def test_part_two():
    assert part_two([14]) == 2
    assert part_two([1969]) == 966
    assert part_two([100756]) == 50346
    assert part_two([14, 1969, 100756]) == 51314
예제 #7
0
def test_part_two():
    assert part_one("test_input2.txt") == 3
    assert part_two("test_input2.txt") == 12
def test_part_two():
    assert s.part_two([0, 3, 0, 1, -3]) == 10
예제 #9
0
def test_part_two():
    data = load_data("test_input.txt")
    assert part_two(data) == 286
예제 #10
0
def test_part_two():
    assert part_two("test_input.txt", preamble_length=5) == 62
예제 #11
0
def test_part_two():
    assert part_two(load_data("invalid_test.txt")) == 0
    assert part_two(load_data("valid_test.txt")) == 4
예제 #12
0
def test_part_two():
    data = load_data('test_input.txt')
    assert part_two(data) == "mxmxvkd,sqjhc,fvjkl"
예제 #13
0
def test_part_two():
    assert part_two(5764801, 17807724) is None
예제 #14
0
def test_part_two():
    assert s.part_two([(5, 9, 2, 8), (9, 4, 7, 3), (3, 8, 6, 5)]) == 9
예제 #15
0
def test_part_two():
    assert part_two("389125467") == 149245887792
예제 #16
0
def test_part_two():
    assert part_two("test_input.txt") == 848
예제 #17
0
def test_part_two():
    data = load_data('test_input.txt')
    assert part_two(data) == 291
예제 #18
0
def test_part_two():
    assert part_two(load_directions("test_input.txt")) == 2208
예제 #19
0
def test_part_two():
    instructions = load_data("test_input2.txt")
    assert part_two(instructions) == 208
예제 #20
0
def test_part_two():
    assert part_two(load_data('test_input.txt')[1]) == 1068781
예제 #21
0
def test_part_two():
    assert s.part_two(example) == 4
예제 #22
0
def test_part_two():
    assert part_two(load_data("testdata.txt")) == 336
예제 #23
0
def test_part_two():
    assert part_two([0, 3, 6]) == 175594