Skip to content

Commit

Permalink
Add failing test for Replay.gameMoveWhileValid
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Oct 7, 2023
1 parent c51157e commit 6941555
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test-kit/src/test/scala/ReplayTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import chess.format.pgn.Fixtures
class ReplayTest extends ChessTest:

"from prod" in:

"replay from position close chess" in:
val fen = EpdFen("""8/rnbqkbnr/pppppppp/8/8/PPPPPPPP/RNBQKBNR/8 w - - 0 1""")
val moves = SanStr from """d4 d5 Nf4 Nf5 g4 g5 gxf5 exf5""".split(' ').toList
Expand All @@ -17,6 +18,14 @@ class ReplayTest extends ChessTest:
games(1)._2._2 === "d5"
}

"replay errors should keep order" in:
val fen = EpdFen("""8/rnbqkbnr/pppppppp/8/8/PPPPPPPP/RNBQKBNR/8 w - - 0 1""")
val moves = SanStr from """d4 d5 Nf3""".split(' ').toList
Replay.gameMoveWhileValid(moves, fen, variant.FromPosition) must beLike { case (_, games, Some(_)) =>
games.size must_== 2
games(1)._2._2 === "d5"
}

"castle rights" in:
"bongcloud attack" in:
Replay.situationsFromUci(
Expand Down

0 comments on commit 6941555

Please sign in to comment.