Marco
ff2ec599fe
In order to simplify special moves like en passant or castling for the client, we want to deliver the board state after every move (and not only start square and end square). With PGN we can encode a chess position into a string. This commit implies changes to logic of the pieces' shortnames. This will break the client/server connection (at least for promotions).
19 lines
284 B
Go
19 lines
284 B
Go
package chess
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func Test_PGN_StartingPosition(t *testing.T) {
|
|
board := newBoard()
|
|
board.Init()
|
|
|
|
pgn := board.pgn()
|
|
|
|
assert.Equal(t,
|
|
"RNBQKBNR/PPPPPPPP/--------/--------/--------/--------/pppppppp/rnbqkbnr",
|
|
pgn)
|
|
}
|