refactor(core): enhance castling logic to include rook movement and improve safety checks
This commit is contained in:
@@ -50,7 +50,7 @@ class PgnParserTest extends AnyFunSuite with Matchers:
|
||||
test("parse queenside castling O-O-O"):
|
||||
val pgn = """[Event "Test"]
|
||||
|
||||
1. d4 d5 2. Nc3 Nc6 3. Bf4 Bf5 4. O-O-O"""
|
||||
1. d4 d5 2. Nc3 Nc6 3. Bf4 Bf5 4. Qd2 Qd7 5. O-O-O"""
|
||||
val game = PgnParser.parsePgn(pgn)
|
||||
game.isDefined shouldBe true
|
||||
val lastMove = game.get.moves.last
|
||||
@@ -71,7 +71,7 @@ class PgnParserTest extends AnyFunSuite with Matchers:
|
||||
test("parse black queenside castling"):
|
||||
val pgn = """[Event "Test"]
|
||||
|
||||
1. d4 d5 2. Nc3 Nc6 3. Bf4 Bf5 4. O-O-O O-O-O"""
|
||||
1. d4 d5 2. Nc3 Nc6 3. Bf4 Bf5 4. Qd2 Qd7 5. O-O-O O-O-O"""
|
||||
val game = PgnParser.parsePgn(pgn)
|
||||
game.isDefined shouldBe true
|
||||
val lastMove = game.get.moves.last
|
||||
|
||||
Reference in New Issue
Block a user