commit 8f1c842cc8cc6ef6a5b8f6020a94d54a83f21542
parent 4edab675e79782ae15324c3a890c87068521b999
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 28 Jan 2024 13:23:20 +0100
tests.sh: remove duplicate tested entries
Diffstat:
M | tests.sh | | | 167 | +++++++++++++++++++++++-------------------------------------------------------- |
1 file changed, 48 insertions(+), 119 deletions(-)
diff --git a/tests.sh b/tests.sh
@@ -610,7 +610,7 @@ tests_pgn
# this includes classical positions.
IFS=" "
-while read -r kingside f kingpos r1pos r2pos; do
+while read -r kingside f kingpos rpos; do
# test last part of the side that is tested.
# 5RK1 - kingside
# 2KR4 - queenside
@@ -619,16 +619,16 @@ while read -r kingside f kingpos r1pos r2pos; do
fb="$(printf '%s' "$f" | tr '[:upper:]' '[:lower:]')"
# test white kingside or queenside castle.
+ move="${kingpos}1${rpos}1"
if test "$kingside" = "1"; then
fullfen="${fb}/pppppppp/8/8/8/8/PPPPPPPP/${f} w Kk - 0 1"
expect="${fb}/pppppppp/8/8/8/8/PPPPPPPP/5RK1 b k - 1 1"
- move="${kingpos}1${r2pos}1"
else
fullfen="${fb}/pppppppp/8/8/8/8/PPPPPPPP/${f} w Qq - 0 1"
expect="${fb}/pppppppp/8/8/8/8/PPPPPPPP/2KR4 b q - 1 1"
- move="${kingpos}1${r1pos}1"
+ move="${kingpos}1${rpos}1"
fi
- testfen "Chess960 position, $fullfen (white), $move" \
+ testfen "Chess960 position, $fullfen (white), $move, kingside? $kingside" \
"$expect" \
"$fullfen" \
"$move"
@@ -644,16 +644,15 @@ while read -r kingside f kingpos r1pos r2pos; do
"$move"
# test black kingside or queenside castle.
+ move="${kingpos}8${rpos}8"
if test "$kingside" = "1"; then
fullfen="${fb}/pppppppp/8/8/8/8/PPPPPPPP/${f} b Kk - 0 1"
expect="5rk1/pppppppp/8/8/8/8/PPPPPPPP/${f} w K - 1 2"
- move="${kingpos}8${r2pos}8"
else
fullfen="${fb}/pppppppp/8/8/8/8/PPPPPPPP/${f} b Qq - 0 1"
expect="2kr4/pppppppp/8/8/8/8/PPPPPPPP/${f} w Q - 1 2"
- move="${kingpos}8${r1pos}8"
fi
- testfen "Chess960 position, $fullfen (black), $move" \
+ testfen "Chess960 position, $fullfen (black), $move, kingside? $kingside" \
"$expect" \
"$fullfen" \
"$move"
@@ -668,118 +667,48 @@ while read -r kingside f kingpos r1pos r2pos; do
"$fullfen" \
"$move"
done <<!
-0 1R1K4 d b e
-0 1R1K4 d b f
-0 1R1K4 d b g
-0 1R1K4 d b h
-0 1R2K3 e b f
-0 1R2K3 e b g
-0 1R2K3 e b h
-0 1R3K2 f b g
-0 1R3K2 f b h
-0 1R4K1 g b h
-0 1RK5 c b d
-0 1RK5 c b e
-0 1RK5 c b f
-0 1RK5 c b g
-0 1RK5 c b h
-0 2R1K3 e c f
-0 2R1K3 e c g
-0 2R1K3 e c h
-0 2R2K2 f c g
-0 2R2K2 f c h
-0 2R3K1 g c h
-0 2RK4 d c e
-0 2RK4 d c f
-0 2RK4 d c g
-0 2RK4 d c h
-0 3R1K2 f d g
-0 3R1K2 f d h
-0 3R2K1 g d h
-0 3RK3 e d f
-0 3RK3 e d g
-0 3RK3 e d h
-0 4R1K1 g e h
-0 4RK2 f e g
-0 4RK2 f e h
-0 5RK1 g f h
-0 R1K5 c a d
-0 R1K5 c a e
-0 R1K5 c a f
-0 R1K5 c a g
-0 R1K5 c a h
-0 R2K4 d a e
-0 R2K4 d a f
-0 R2K4 d a g
-0 R2K4 d a h
-0 R3K3 e a f
-0 R3K3 e a g
-0 R3K3 e a h
-0 R4K2 f a g
-0 R4K2 f a h
-0 R5K1 g a h
-0 RK6 b a c
-0 RK6 b a d
-0 RK6 b a e
-0 RK6 b a f
-0 RK6 b a g
-0 RK6 b a h
-1 1K1R4 b a d
-1 1K2R3 b a e
-1 1K3R2 b a f
-1 1K4R1 b a g
-1 1K5R b a h
-1 1KR5 b a c
-1 2K1R3 c a e
-1 2K1R3 c b e
-1 2K2R2 c a f
-1 2K2R2 c b f
-1 2K3R1 c a g
-1 2K3R1 c b g
-1 2K4R c a h
-1 2K4R c b h
-1 2KR4 c a d
-1 2KR4 c b d
-1 3K1R2 d a f
-1 3K1R2 d b f
-1 3K1R2 d c f
-1 3K2R1 d a g
-1 3K2R1 d b g
-1 3K2R1 d c g
-1 3K3R d a h
-1 3K3R d b h
-1 3K3R d c h
-1 3KR3 d a e
-1 3KR3 d b e
-1 3KR3 d c e
-1 4K1R1 e a g
-1 4K1R1 e b g
-1 4K1R1 e c g
-1 4K1R1 e d g
-1 4K2R e a h
-1 4K2R e b h
-1 4K2R e c h
-1 4K2R e d h
-1 4KR2 e a f
-1 4KR2 e b f
-1 4KR2 e c f
-1 4KR2 e d f
-1 5K1R f a h
-1 5K1R f b h
-1 5K1R f c h
-1 5K1R f d h
-1 5K1R f e h
-1 5KR1 f a g
-1 5KR1 f b g
-1 5KR1 f c g
-1 5KR1 f d g
-1 5KR1 f e g
-1 6KR g a h
-1 6KR g b h
-1 6KR g c h
-1 6KR g d h
-1 6KR g e h
-1 6KR g f h
+0 1R1K4 d b
+0 1R2K3 e b
+0 1R3K2 f b
+0 1R4K1 g b
+0 1RK5 c b
+0 2R1K3 e c
+0 2R2K2 f c
+0 2R3K1 g c
+0 2RK4 d c
+0 3R1K2 f d
+0 3R2K1 g d
+0 3RK3 e d
+0 4R1K1 g e
+0 4RK2 f e
+0 5RK1 g f
+0 R1K5 c a
+0 R2K4 d a
+0 R3K3 e a
+0 R4K2 f a
+0 R5K1 g a
+0 RK6 b a
+1 1K1R4 b d
+1 1K2R3 b e
+1 1K3R2 b f
+1 1K4R1 b g
+1 1K5R b h
+1 1KR5 b c
+1 2K1R3 c e
+1 2K2R2 c f
+1 2K3R1 c g
+1 2K4R c h
+1 2KR4 c d
+1 3K1R2 d f
+1 3K2R1 d g
+1 3K3R d h
+1 3KR3 d e
+1 4K1R1 e g
+1 4K2R e h
+1 4KR2 e f
+1 5K1R f h
+1 5KR1 f g
+1 6KR g h
!
if test "$statuscode" = "1"; then