test(core): add GameEngineLoadGameTest for loadGame/exportGame
Add 3 focused tests for GameEngine load/export functionality: - loadGame with PgnParser validates PGN parsing and undo/redo state - loadGame with FenParser validates position loading without move replay - exportGame with PgnExporter validates PGN output Fix: PgnParser now extends GameContextImport trait for consistency with FenParser. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package de.nowchess.io.pgn
|
||||
import de.nowchess.api.board.*
|
||||
import de.nowchess.api.move.{Move, MoveType, PromotionPiece}
|
||||
import de.nowchess.api.game.{GameContext, HistoryMove}
|
||||
import de.nowchess.io.GameContextImport
|
||||
import de.nowchess.rules.sets.DefaultRules
|
||||
|
||||
/** A parsed PGN game containing headers and the resolved move list. */
|
||||
@@ -11,7 +12,7 @@ case class PgnGame(
|
||||
moves: List[HistoryMove]
|
||||
)
|
||||
|
||||
object PgnParser:
|
||||
object PgnParser extends GameContextImport:
|
||||
|
||||
/** Strictly validate a PGN text.
|
||||
* Returns Right(PgnGame) if every move token is a legal move in the evolving position.
|
||||
|
||||
Reference in New Issue
Block a user