diff options
| author | dickmao <rchiang@cs.stonybrook.edu> | 2018-08-28 21:48:31 -0400 |
|---|---|---|
| committer | dickmao <dick.r.chiang@gmail.com> | 2018-08-30 00:14:42 -0400 |
| commit | 800dd7677276f9e425c5db37b3e31e56ab1dad32 (patch) | |
| tree | 09eb145ffcbaf89d873c89e8346ee8d38a88ebbe /chess-engine.el | |
| parent | 5bd1e7248bb9bf3b335cbd6bec250866bd165af1 (diff) | |
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.
Diffstat (limited to 'chess-engine.el')
| -rw-r--r-- | chess-engine.el | 9 |
1 files changed, 5 insertions, 4 deletions
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)) |
