Exemplo n.º 1
0
def test_1():
    testinput = (
        "5 9 2 8\n",
        "9 4 7 3\n",
        "3 8 6 5\n",
    )
    assert solution2.solve(testinput) == 9
Exemplo n.º 2
0
def test_solve():
    testdata = (
        "b inc 5 if a > 1\n",
        "a inc 1 if b < 5\n",
        "c dec -10 if a >= 1\n",
        "c inc -20 if c == 10\n",
    )
    assert solution2.solve(testdata) == 10
Exemplo n.º 3
0
def test_solve():
    data = [
        0,
        3,
        0,
        1,
        -3,
    ]
    assert solution2.solve(data) == 10
Exemplo n.º 4
0
def test_solve():
    data = (
            "abcde fghij\n",
            "abcde xyz ecdab\n",
            "a ab abc abd abf abj\n",
            "iiii oiii ooii oooi oooo\n",
            "oiii ioii iioi iiio\n",
            )
    assert solution2.solve(data) == 3
Exemplo n.º 5
0
def test_solve():
    testdata = (
    "pbga (66)\n",
    "xhth (57)\n",
    "ebii (61)\n",
    "havc (66)\n",
    "ktlj (57)\n",
    "fwft (72) -> ktlj, cntj, xhth\n",
    "qoyq (66)\n",
    "padx (45) -> pbga, havc, qoyq\n",
    "tknk (41) -> ugml, padx, fwft\n",
    "jptl (61)\n",
    "ugml (68) -> gyxo, ebii, jptl\n",
    "gyxo (61)\n",
    "cntj (57)\n",)
    assert solution2.solve(testdata) == 60
Exemplo n.º 6
0
def test_3():
    testdata = "<<<<>"
    assert solution2.solve(testdata) == 3
Exemplo n.º 7
0
def test_2():
    testdata = "<random characters>"
    assert solution2.solve(testdata) == 17
Exemplo n.º 8
0
def test_1():
    testdata = "<>"
    assert solution2.solve(testdata) == 0
Exemplo n.º 9
0
def test_4():
    input_line = "1,2,4"
    thelist = list(range(256))
    assert solution2.solve(thelist,
                           input_line) == "63960835bcdc130f0b66d7ff4f6a5a8e"
Exemplo n.º 10
0
def test_2():
    input_line = "AoC 2017"
    thelist = list(range(256))
    assert solution2.solve(thelist,
                           input_line) == "33efeb34ea91902bb2f59c9920caa6cd"
Exemplo n.º 11
0
def test_9():
    testdata = '{{},{}, <123>, <12!3!>4>}'
    assert solution2.solve(testdata) == 6
Exemplo n.º 12
0
def test_7():
    testdata = '<{o"i!a,<{i<a>'
    assert solution2.solve(testdata) == 10
Exemplo n.º 13
0
def test_1():
    assert solution2.solve("1212") == 6
Exemplo n.º 14
0
def test_5():
    assert solution2.solve("12131415") == 4
Exemplo n.º 15
0
def test_4():
    assert solution2.solve("123123") == 12
Exemplo n.º 16
0
def test_3():
    assert solution2.solve("123425") == 4
Exemplo n.º 17
0
def test_1():
    assert solution2.solve(65, 8921) == 309
Exemplo n.º 18
0
def test_4():
    testdata = "<{!>}>"
    assert solution2.solve(testdata) == 2
Exemplo n.º 19
0
def test_6():
    testdata = "<!!!>>"
    assert solution2.solve(testdata) == 0
Exemplo n.º 20
0
def test_2():
    assert solution2.solve("1221") == 0
Exemplo n.º 21
0
def test_8():
    testdata = '{{{{{{{<>},<<!>},<,>},{{<oou<o{!>,<i!!!!!>!!ouu}i>}}}}}}'
    assert solution2.solve(testdata) == 19
Exemplo n.º 22
0
def test_solve():
    data = [0, 2, 7, 0]
    assert solution2.solve(data) == 4
Exemplo n.º 23
0
def test_1():
    assert solution2.solve(testdata) == 10
Exemplo n.º 24
0
def test_1():
    input_line = ""
    thelist = list(range(256))
    assert solution2.solve(thelist,
                           input_line) == "a2582a3a0e66e6e86e3812dcb672a272"
Exemplo n.º 25
0
def test_1():
    assert solution2.solve('flqrgnkx') == 1242
Exemplo n.º 26
0
def test_3():
    input_line = "1,2,3"
    thelist = list(range(256))
    assert solution2.solve(thelist,
                           input_line) == "3efbe78a8d82f29979031a4aa0b16a9d"