Make the Wilson test actually test something.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3bf438ffb9
commit
9599be21b3
1 changed files with 31 additions and 2 deletions
|
@ -4,12 +4,41 @@ import ch.fritteli.maze.generator.model.Maze;
|
|||
import ch.fritteli.maze.generator.renderer.text.TextRenderer;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class WilsonTest {
|
||||
@Test
|
||||
void foo() {
|
||||
final Maze maze = new Maze(50, 10, 0);
|
||||
// arrange
|
||||
final Maze maze = new Maze(10, 10, 0);
|
||||
final Wilson wilson = new Wilson(maze);
|
||||
|
||||
// act
|
||||
wilson.run();
|
||||
System.out.println(TextRenderer.newInstance().render(maze));
|
||||
|
||||
// assert
|
||||
final String textRepresentation = TextRenderer.newInstance().render(maze);
|
||||
assertThat(textRepresentation).isEqualTo("""
|
||||
╷ ╶─────┬─────┬───┬─┐
|
||||
│ │ │ │ │
|
||||
│ ╷ ╶─┬─┴─┬─╴ ╵ ╷ │ │
|
||||
│ │ │ │ │ │ │
|
||||
│ └─┐ │ ╶─┼─┬─┬─┘ │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
│ ╷ │ └─╴ │ ╵ ╵ ╶─┘ │
|
||||
│ │ │ │ │
|
||||
├─┴─┘ ╷ ┌─┴───┐ ╷ ╶─┤
|
||||
│ │ │ │ │ │
|
||||
│ ╷ ┌─┘ └───╴ │ └─┬─┤
|
||||
│ │ │ │ │ │
|
||||
├─┴─┘ ┌───╴ ╷ └─┐ ╵ │
|
||||
│ │ │ │ │
|
||||
│ ╶─┬─┴─╴ ┌─┘ ╶─┘ ╶─┤
|
||||
│ │ │ │
|
||||
├─╴ ├─╴ ┌─┘ ╶─┐ ╶───┤
|
||||
│ │ │ │ │
|
||||
├───┴─╴ └─┐ ╶─┴───┐ │
|
||||
│ │ │ │
|
||||
└─────────┴───────┘ ╵""");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue