Skip to content

Commit

Permalink
Add failing test SmallFen conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Dec 14, 2023
1 parent f57235c commit ad76af5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test-kit/src/test/scala/format/SmallFenTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,25 @@ class SmallFenTest extends ChessTest:
SmallFen.make(Standard, Fen.Simple("rnbqkb1r/ppp1pppp/3p4/3nP3/3P4/5N2/PPP2PPP/RNBQKB1R b KQkq -")),
SmallFen("rnbqkb1rppp1pppp3p43nP33P45N2PPP2PPPRNBQKB1RbKQkq")
)

test("standard, skip w, b6 en passant"):
assertEquals(
SmallFen.make(Standard, Fen.Simple("8/8/p1k2nB1/Pp1np3/1PK4P/8/3B4/8 w - b6")).pp.garbageInefficientReadBackIntoFen,
SimpleFen("8/8/p1k2nB1/Pp1np3/1PK4P/8/3B4/8 w - b6")
)

test("make standard correct, skip w"):
assertEquals(
SmallFen.make(Standard, Fen.Simple("rnbqkb1r/ppp1pppp/3p4/3nP3/3P4/5N2/PPP2PPP/RNBQKB1R w KQkq -")),
SmallFen("rnbqkb1rppp1pppp3p43nP33P45N2PPP2PPPRNBQKB1RKQkq")
)

test("make standard correct, non-initial castling"):
assertEquals(
SmallFen.make(Standard, Fen.Simple("rnbqkb1r/ppp1pppp/3p4/3nP3/3P4/5N2/PPP2PPP/RNBQKB1R w Qq -")),
SmallFen("rnbqkb1rppp1pppp3p43nP33P45N2PPP2PPPRNBQKB1RQq")
)

test("make standard correct, en passant"):
assertEquals(
SmallFen
Expand Down Expand Up @@ -144,7 +153,7 @@ class SmallFenTest extends ChessTest:
"k7/2K5/8/2B5/8/p7/P7/8 b - -",
"1k6/1P6/1K6/2P5/8/8/8/8 b - -",
"8/8/5R2/8/8/8/7p/5K1k b - -",
"8/8/8/8/8/5p2/5K1p/7k b - -"
"8/8/8/8/8/5p2/5K1p/7k b - -",
).foreach: fen =>
assertEquals(
toFen(SmallFen.make(Standard, Fen.Simple(fen)).value),
Expand Down

0 comments on commit ad76af5

Please sign in to comment.