2026-rff_mp/pogodinda/lab2/tests/test_builder.py

26 lines
928 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from src.maze_builder import TextFileMazeBuilder, RandomMazeBuilder
# Тест 1: Загрузка из файла
print("=" * 50)
print("ТЕСТ 1: Загрузка из файла")
print("=" * 50)
builder = TextFileMazeBuilder()
maze = builder.build_from_file("data/demo_maze.txt")
print(maze)
print(f"\nРазмер: {maze.width}x{maze.height}")
print(f"Старт: ({maze.start.x}, {maze.start.y})")
print(f"Выход: ({maze.exit.x}, {maze.exit.y})")
# Тест 2: Случайный лабиринт
print("\n" + "=" * 50)
print("ТЕСТ 2: Случайный лабиринт 21x11")
print("=" * 50)
random_builder = RandomMazeBuilder(21, 11)
random_maze = random_builder.build_from_file()
print(random_maze)
print(f"\nРазмер: {random_maze.width}x{random_maze.height}")
print(f"Старт: ({random_maze.start.x}, {random_maze.start.y})")
print(f"Выход: ({random_maze.exit.x}, {random_maze.exit.y})")