Beispiel #1
0
def test_default_board():
    """Some tests on default board."""

    brd = Board()
    assert brd.position_adjustment(1) == 39
    assert brd.position_adjustment(2) == 0
    assert brd.position_adjustment(33) == -30
    assert not brd.goal_reached(89)
    assert brd.goal_reached(90)
    assert brd.goal_reached(91)
Beispiel #2
0
def test_goal_reached():
    """Ensure goal_reached() does not yield false negatives."""
    goal_pos = 20
    brd = Board(ladders=[], chutes=[], goal=goal_pos)
    for pos in range(goal_pos, goal_pos + 10):
        assert brd.goal_reached(pos)