aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-09-14 04:45:45 +0300
committereug-vs <eugene@eug-vs.xyz>2022-09-14 04:45:45 +0300
commitc6c53e253d2be076ab531cc14e00eb204f2cbb43 (patch)
tree82f557a32a37d38d700668c73a9c1cce0efb73c8
parent031ccb2d9e7993ed46bd40a5c3c78af86cb46ba4 (diff)
downloadj1chess-c6c53e253d2be076ab531cc14e00eb204f2cbb43.tar.gz
test: add more unit tests to FEN parsing
-rw-r--r--src/main.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 97e5d14..5f19585 100644
--- a/src/main.c
+++ b/src/main.c
@@ -29,11 +29,14 @@ int main() {
}
{
- start_test_section("FEN String");
+ start_test_section("Default FEN string");
Board board = parse_FEN("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
- unit_test(pop_count(board.pieces[PAWN] | board.pieces[PAWN | BLACK]) == 16, "Default position has 16 pawns total");
- unit_test(pop_count(board.pieces[ROOK]) == 2, "Default position has 2 white rooks");
- unit_test(board.side == WHITE, "Side to moveSide to move is white");
+ unit_test(pop_count(board.pieces[PAWN] | board.pieces[PAWN | BLACK]) == 16, "There are 16 pawns total");
+ unit_test(pop_count(board.pieces[ROOK]) == 2, "There are 2 white rooks");
+ // TODO
+ unit_test(board.side == WHITE, "Side to move is white");
+ unit_test(board.castling_rights == 0, "Everyone can castle");
+ unit_test(board.en_passant_square == 0, "No en passant move is avaialble");
}
report();