Skip to content

Commit

Permalink
fixup! Add some tests and Travis integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Peque committed Mar 21, 2018
1 parent cbc7703 commit 1168727
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test_mazes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Basic tests to ensure maze files are properly formatted.
"""
from collections import Counter
from pathlib import Path
import re

Expand Down Expand Up @@ -114,6 +115,15 @@ def test_boundaries(maze_file):
assert all(h == '---' for h in north_boundary + south_boundary)


@all_mazes
def test_starting_cell_unique(maze_file):
"""
The starting cell, if marked, must be unique.
"""
rows = read_maze(maze_file)
assert Counter(''.join(rows))['S'] in (0, 1)


@competition_mazes
def test_starting_cell(maze_file):
"""
Expand Down

0 comments on commit 1168727

Please sign in to comment.