Skip to content

Commit 436e606

Browse files
authored
Merge pull request #3 from ripred/codex/analyze-architecture-and-find-major-bug
Add failing test for draw by repetition
2 parents 05f8dda + 6d4668d commit 436e606

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

test/DrawByRepetitionTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import org.junit.Test;
2+
import static org.junit.Assert.*;
3+
4+
public class DrawByRepetitionTest {
5+
@Test
6+
public void testCheckDrawByRepetition() {
7+
LiteBoard board = new LiteBoard();
8+
// create a simple move
9+
Move move = new Move(0,0,0,1,0);
10+
board.lastMove = move;
11+
// simulate repeating the same move three times
12+
for (int i = 0; i < 6; i++) {
13+
board.history[i] = move;
14+
}
15+
board.numHist = 6;
16+
boolean result = board.checkDrawByRepetition(board.lastMove, 3);
17+
assertTrue("Draw by repetition should be detected", result);
18+
}
19+
}

0 commit comments

Comments
 (0)