feat: updated for 100% coverage
Build & Test (NowChessSystems) TeamCity build finished

This commit is contained in:
2026-04-14 20:45:07 +02:00
parent 50ecc0fd4d
commit 247724e57c
4 changed files with 123 additions and 0 deletions
@@ -318,3 +318,14 @@ class DefaultRulesStateTransitionsTest extends AnyFunSuite with Matchers:
queen.board.pieceAt(sq("a8")) shouldBe Some(Piece(Color.White, PieceType.Queen))
rook.board.pieceAt(sq("a8")) shouldBe Some(Piece(Color.White, PieceType.Rook))
bishop.board.pieceAt(sq("a8")) shouldBe Some(Piece(Color.White, PieceType.Bishop))
test("applyMove preserves castling rights when rook moves from non-starting square"):
val context = contextFromFen("r3k2r/8/8/8/8/8/4R3/4K3 w KQkq - 0 1")
val move = Move(sq("e2"), sq("e3"))
val next = DefaultRules.applyMove(context)(move)
next.castlingRights.whiteKingSide shouldBe true
next.castlingRights.whiteQueenSide shouldBe true
next.castlingRights.blackKingSide shouldBe true
next.castlingRights.blackQueenSide shouldBe true