Fix SIGSEGV in tests

This commit is contained in:
ekzyis 2024-09-18 05:39:57 +02:00
parent bd1c0b3c6e
commit 552f42cc96
1 changed files with 4 additions and 3 deletions

View File

@ -81,9 +81,10 @@ func assertPiece(t *testing.T, b *chess.Board, position string, name chess.Piece
msg := fmt.Sprintf("expected %s %s at %s", c, name, position)
assert.NotNil(t, p, msg)
if assert.NotNil(t, p, msg) {
assert.Equal(t, name, p.Name, msg)
assert.Equal(t, color, p.Color, msg)
}
}
func assertNoPiece(t *testing.T, b *chess.Board, position string) {