try std.testing.expectEqual(@as(usize, 49), gs.moves.len);
}
test "backup and restore" {
const tricky_position = "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq c6 0 1";
var gs = try GameState.init(tricky_position);
const backup = gs.backup();
gs.bitboards[PE.P.int()].b8 = true;
gs.enpassant = null;
gs.castling = .{};
gs.side = .black;
gs.restore(backup);
try std.testing.expectEqual(false, gs.bitboards[PE.P.int()].h8);
try std.testing.expectEqual(Square.c6, gs.enpassant.?);
try std.testing.expectEqual(@as(u4, 0b1111), @bitCast(u4, gs.castling));