示例#1
0
文件: day24.py 项目: matajoh/aoc_2019
def test_step():
    """ Test """
    states = read_tests("day24_tests.txt")
    bugs = _parse_bugs(states[0])
    for lines in states[1:]:
        expected_bugs = _parse_bugs(lines)
        bugs = _step(bugs)
        assert bugs == expected_bugs
示例#2
0
文件: day24.py 项目: matajoh/aoc_2019
def test_step_recursive():
    """ Test """
    lines = read_tests("day24_tests.txt")[0]
    bugs = _parse_bugs_recursive(lines)
    for _ in range(10):
        bugs = _step_recursive(bugs)
        print(len(bugs))

    _print_recursive(bugs)

    assert len(bugs) == 99
示例#3
0
文件: day14.py 项目: matajoh/aoc_2019
def tests():
    """ Test fixture """
    return read_tests("day14_tests.txt")
示例#4
0
文件: day22.py 项目: matajoh/aoc_2019
def tests():
    """ Fixture """
    return read_tests("day22_tests.txt")
示例#5
0
文件: day24.py 项目: matajoh/aoc_2019
def test_first_repeat():
    """ Test """
    lines = read_tests("day24_tests.txt")[0]
    assert find_first_repeat(lines) == 2129920