From 800dd7677276f9e425c5db37b3e31e56ab1dad32 Mon Sep 17 00:00:00 2001 From: dickmao Date: Tue, 28 Aug 2018 21:48:31 -0400 Subject: Add tests for castling legality and ics response handling. Fixes misinterpretation of "e1-b1" as a valid queenside castle, and makes more sense of ics basic response handling #21. `make test` should run the historic.pgn test and the new ecukes tests. --- chess-engine.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'chess-engine.el') diff --git a/chess-engine.el b/chess-engine.el index 0fef4b0..0ac7541 100644 --- a/chess-engine.el +++ b/chess-engine.el @@ -136,7 +136,7 @@ If conversion fails, this function fired an 'illegal event." ((eq event 'match) (if (chess-game-data game 'active) (chess-engine-command nil 'busy) - (let ((name (and (> (length (car args)) 0) (car args)))) + (let ((name (> (length (car args)) 0))) (if (y-or-n-p (if name (chess-string 'want-to-play (car args)) (chess-string 'want-to-play-a))) @@ -291,9 +291,10 @@ If conversion fails, this function fired an 'illegal event." (chess-game-run-hooks game 'flag-fell)))) ((eq event 'flag-fell) - (chess-message 'opp-flag-fell) - (chess-game-end game :flag-fell) - (chess-game-set-data game 'active nil)) + (let ((chess-engine-handling-event t)) + (chess-message 'opp-flag-fell) + (chess-game-end game :flag-fell) + (chess-game-set-data game 'active nil))) ((eq event 'kibitz) (let ((chess-engine-handling-event t)) -- cgit v1.2.3