Extend insufficient material tests
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 5 Jul 2025 21:24:20 +0000 (23:24 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 5 Jul 2025 21:24:20 +0000 (23:24 +0200)
src/apiutil.h
test.py

index d39102f..1886c54 100644 (file)
@@ -388,7 +388,7 @@ inline bool has_insufficient_material(Color c, const Position& pos) {
     }
 
     // Mating pieces
-    for (PieceType pt : { ROOK, QUEEN, ARCHBISHOP, CHANCELLOR, SILVER, GOLD, COMMONER, CENTAUR })
+    for (PieceType pt : { ROOK, QUEEN, ARCHBISHOP, CHANCELLOR, SILVER, GOLD, COMMONER, CENTAUR, AMAZON, BERS })
         if ((pos.pieces(c, pt) & ~restricted) || (pos.count(c, pos.promotion_pawn_type(c)) && (pos.promotion_piece_types(c) & pt)))
             return false;
 
diff --git a/test.py b/test.py
index f235748..83f41c9 100644 (file)
--- a/test.py
+++ b/test.py
@@ -174,6 +174,10 @@ variant_positions = {
     "newzealand": {
         "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1": (False, False),  # startpos
     },
+    "amazon": {
+        "rnbakbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBAKBNR w KQkq - 0 1": (False, False),  # startpos
+        "8/8/8/8/A7/6k1/8/1K6 w - - 0 1": (False, True),  # KA vs K
+    },
     "seirawan": {
         "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[HEhe] w KQBCDFGkqbcdfg - 0 1": (False, False),  # startpos
         "k7/8/8/8/8/8/8/K7[] w - - 0 1": (True, True),  # K vs K