You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for writing this library, it's extremely useful! The only thing I'm having trouble with is that it doesn't seem like en passant target squares are correctly handled by the FEN generation code. Here's an example:
import{Chess}from"chessops/chess";import{makeFen}from"chessops/fen";import{parseSan}from"chessops/san";describe("When generating FEN",()=>{test("en passant target square is in EPD",()=>{constchess=Chess.default();chess.play(parseSan(chess,"a4"));expect(makeFen(chess.toSetup())).toBe("rnbqkbnr/pppppppp/8/8/P7/8/1PPPPPPP/RNBQKBNR b KQkq a3 0 1");});}
which fails with:
Error: expect(received).toBe(expected) // Object.is equality
Expected: "rnbqkbnr/pppppppp/8/8/P7/8/1PPPPPPP/RNBQKBNR b KQkq a3 0 1"
Received: "rnbqkbnr/pppppppp/8/8/P7/8/1PPPPPPP/RNBQKBNR b KQkq - 0 1"
The text was updated successfully, but these errors were encountered:
Hi, like on Lichess and similar to X-FEN, the en passant square is only included if there is actually a legal en passant move. If you really need it, you can force it as follows:
Oh, that makes sense & is completely fine for my needs; I just need to adjust some of my my test cases a little. Thanks for the very fast response (and wonderful library)!
Hello,
Thanks for writing this library, it's extremely useful! The only thing I'm having trouble with is that it doesn't seem like en passant target squares are correctly handled by the FEN generation code. Here's an example:
which fails with:
The text was updated successfully, but these errors were encountered: