Skip to content

Commit 9bb38a3

Browse files
committed
Add test for pawn moves on edge ranks
1 parent f31e271 commit 9bb38a3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

__tests__/regression.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ describe('Regression Tests', () => {
2929
expect(chess.moves().join(' ')).toBe('Kd2 Ke2 Kxf2 Kf1 Kd1')
3030
})
3131

32+
it('Github Issue ##577 - pawn on edge rank should have no moves', () => {
33+
const chess = new Chess()
34+
chess.clear()
35+
chess.put({ type: 'k', color: 'w' }, 'e1')
36+
chess.put({ type: 'k', color: 'b' }, 'e8')
37+
chess.put({ type: 'p', color: 'w' }, 'h8')
38+
expect(chess.moves({ square: 'h8', verbose: true })).toEqual([])
39+
})
40+
3241
it('Github Issue #85 (white) - SetUp and FEN should be accepted in loadPgn', () => {
3342
const chess = new Chess()
3443
const pgn = [

0 commit comments

Comments
 (0)