From c6c53e253d2be076ab531cc14e00eb204f2cbb43 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 14 Sep 2022 04:45:45 +0300 Subject: test: add more unit tests to FEN parsing --- src/main.c | 11 +++++++---- 1 file 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(); -- cgit v1.2.3