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. --- features/support/env.el | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 features/support/env.el (limited to 'features/support/env.el') diff --git a/features/support/env.el b/features/support/env.el new file mode 100644 index 0000000..58ed42f --- /dev/null +++ b/features/support/env.el @@ -0,0 +1,43 @@ +(require 'f) + +(defvar emacs-chess-support-path + (f-dirname load-file-name)) + +(defvar emacs-chess-features-path + (f-parent emacs-chess-support-path)) + +(defvar emacs-chess-root-path + (f-parent emacs-chess-features-path)) + +(add-to-list 'load-path emacs-chess-root-path) + +(require 'chess-ics) +(require 'espuds) +(require 'ert) +(require 'cl) + +(Setup + (defvar test-display nil) + (defvar test-fifo nil) +) + +(Before + ;; Before each scenario is run + ) + +(After + ;; After each scenario is run + (when test-display + (chess-module-destroy test-display) + (setq test-display nil)) + (when (process-status "*chess-ics*") + (delete-process "*chess-ics*")) + (when test-fifo + (process-send-eof test-fifo) + (delete-process test-fifo) + (setq test-fifo nil)) +) + +(Teardown + ;; After when everything has been run + ) -- cgit v1.2.3