branch: elpa/geiser-stklos commit be482a03225720d7adb003c28e4515f6252e7ce2 Author: Jeronimo Pellegrini <j...@aleph0.info> Commit: Jeronimo Pellegrini <j...@aleph0.info>
Fix tests and describe them in README --- README.md | 24 +++++++++++++++++++++++- geiser-stklos-test.el | 42 ++++++++++++++++++++++++++---------------- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index fdf991e..a0ec235 100644 --- a/README.md +++ b/README.md @@ -26,11 +26,16 @@ See the Geiser manual for usage. # Installation +## From MELPA + Geiser-STklos is available on MELPA, so `M-x install-package` followed by `geiser-stklos` should get it installed, and this is the recommended method. +## From source + There are other ways to install Geiser and Geiser-STklos. One possibility is -to add this to your Emacs configuration: +to add this to your Emacs configuration (Guile is used here as an example +of another supported implementation, used along with Geiser-STklos): ``` (setq-default geiser-active-implementations @@ -47,6 +52,23 @@ to add this to your Emacs configuration: (require 'geiser-stklos) ``` +### Testing + +Geiser-STklos comes with two test suites -- one for the Emacs Lisp part of +the system (using `ert`), and one for the STklos part (using STklos' own test +system). To run both suites: + +``` +make test +``` + +The STklos tests will create a log file called `TEST.LOG`. The Emacs Lisp tests +will write to `test-emacs-stdout.log`, but only when errors occur. + +The tests are very rudimentary because writing a full test suite for the Emacs +Lisp part would be a bit complex, although not impossible: we'd need to start +STklos, load geiser on it, and feed it some forms before starting the tests. + # Bugs See the issue tracker in Gitlab. diff --git a/geiser-stklos-test.el b/geiser-stklos-test.el index bfb435d..6ad4f37 100644 --- a/geiser-stklos-test.el +++ b/geiser-stklos-test.el @@ -10,25 +10,35 @@ (ert-deftest geiser-stklos--loaded () (should (member 'geiser-stklos features))) +;; Go to char in position 7 and find the closing parenthesis +;; of the form -- which is in position 29 (ert-deftest find-close-par () - 29 - (with-temp-buffer - (insert "(let* ((let 'let) (let* let)) let)") - (goto-char 7) - (geiser-stklos--find-close-par))) - + (should (= 30 + (with-temp-buffer + (insert "(let* ((let 'let) (let* let)) let)") + (goto-char 7) + (geiser-stklos--find-close-par))))) + +;; Go to char in position 10 and find the closing parenthesis +;; of the form -- which is in position 18 (ert-deftest find-close-par-2 () - 18 - (with-temp-buffer - (insert "(let* ((let 'let) (let* let)) let)") - (goto-char 10) - (geiser-stklos--find-close-par 8))) + (should (= 18 + (with-temp-buffer + (insert "(let* ((let 'let) (let* let)) let)") + (goto-char 10) + (geiser-stklos--find-close-par 8))))) + ;; this one could have many more variants +;; Go to char in position 7 and find the beginning of the symbol +;; -- which is in position 6 (ert-deftest geiser-stklos--symbol-begin () - 5 - (with-temp-buffer - (insert "(abc def (ghijkl))") - (goto-char 7) - (geiser-stklos--symbol-begin nil))) + (should (= 6 + (with-temp-buffer + (insert "(abc def (ghijkl))") + (goto-char 7) + (geiser-stklos--symbol-begin nil))))) + + +