diff options
| author | Craig Jennings <c@cjennings.net> | 2025-10-19 18:49:00 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-10-19 18:49:00 -0500 |
| commit | e1d60d2110987f1060c0b37d032621c669d97d5e (patch) | |
| tree | 2ff171a86f28593da724bb754d80278e74cf8f5d /features/step-definitions/emacs-chess-steps.el | |
| parent | 865b2ab11469f3bd1bc4d7b3669cb4626c37be08 (diff) | |
fix: all: fixes to get emacs-chess working on 30.2
- added lexical-binding headers to all source files
- replaced make-variable-buffer-local with defvar-local throughout source code
- replaced deprecated cl library with cl-lib, including replacing assert with cl-assert to emacs-chess-steps.el
- added proper headers and footers to test files when missing
- populated chess images and chess sounds directory
- fixed defcustom calling directory-files without error handling.
xboard installation no longer required.
Diffstat (limited to 'features/step-definitions/emacs-chess-steps.el')
| -rw-r--r-- | features/step-definitions/emacs-chess-steps.el | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/features/step-definitions/emacs-chess-steps.el b/features/step-definitions/emacs-chess-steps.el index b0d2ae0..e948062 100644 --- a/features/step-definitions/emacs-chess-steps.el +++ b/features/step-definitions/emacs-chess-steps.el @@ -1,7 +1,13 @@ +;;; emacs-chess-steps.el --- Project specific step definitions -*- lexical-binding: t; -*- + ;; This file contains your project specific step definitions. All ;; files in this directory whose names end with "-steps.el" will be ;; loaded automatically by Ecukes. +;;; Code: + +(require 'cl-lib) + (Given "^ics session$" (lambda () (let ((test-fn (expand-file-name (make-temp-name "test-fifo") (or small-temporary-file-directory temporary-file-directory)))) @@ -75,7 +81,7 @@ (Then "^the move \"\\([a-h][1-8]\\)-\\([a-h][1-8]\\)\" is illegal$" (lambda (source target) (let ((position (chess-display-position test-display))) - (assert (null (chess-ply-create position nil + (cl-assert (null (chess-ply-create position nil (chess-coord-to-index source) (chess-coord-to-index target))))))) @@ -107,7 +113,7 @@ (lambda (times micros) (dotimes (i (string-to-number times)) (let ((ply (chess-game-ply chess-module-game (1- (- chess-display-index i))))) - (assert (< (measure-time (chess-display-paint-move nil ply)) + (cl-assert (< (measure-time (chess-display-paint-move nil ply)) (/ (string-to-number micros) 1e6))))))) (Given "^I start server and client$" @@ -164,10 +170,10 @@ chess-display-legal-move-color) (t chess-display-last-move-color)) (chess-coord-to-index source)) - (assert (equal prop (get-text-property + (cl-assert (equal prop (get-text-property (chess-display-index-pos nil (chess-coord-to-index source)) 'display)))) - (assert (eq (get-text-property + (cl-assert (eq (get-text-property (chess-display-index-pos nil (chess-coord-to-index source)) 'face) (cond ((string= kind "selected") 'chess-ics1-highlight-face) (t 'chess-display-highlight))))))) @@ -179,9 +185,11 @@ (chess-display-index-pos nil (chess-coord-to-index source)) 'display)))) (chess-display-unhighlight-square nil (chess-coord-to-index source)) - (assert (equal prop (get-text-property + (cl-assert (equal prop (get-text-property (chess-display-index-pos nil (chess-coord-to-index source)) 'display)))) - (assert (not (eq (get-text-property + (cl-assert (not (eq (get-text-property (chess-display-index-pos nil (chess-coord-to-index source)) 'face) 'chess-display-highlight)))))) + +;;; emacs-chess-steps.el ends here |
