emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/geiser-stklos b4211af83d: More tests for the Emacs Lisp si


From: ELPA Syncer
Subject: [nongnu] elpa/geiser-stklos b4211af83d: More tests for the Emacs Lisp side
Date: Fri, 7 Jul 2023 21:59:26 -0400 (EDT)

branch: elpa/geiser-stklos
commit b4211af83d3662bee65db2ebbd63531bc4a9a921
Author: Jeronimo Pellegrini <j_p@aleph0.info>
Commit: Jeronimo Pellegrini <j_p@aleph0.info>

    More tests for the Emacs Lisp side
---
 geiser-stklos-test.el | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/geiser-stklos-test.el b/geiser-stklos-test.el
index 6ad4f37850..3c8d6a54de 100644
--- a/geiser-stklos-test.el
+++ b/geiser-stklos-test.el
@@ -28,7 +28,53 @@
                (goto-char 10)
                (geiser-stklos--find-close-par 8)))))
 
+;; Go to char in position 5. This is NOT inside a module, so :f should
+;; be returned.
+(ert-deftest get-module-1 ()
+  (should (eq :f
+              (with-temp-buffer
+                (insert "(define x 1)\n\n(define-library y (begin (define z 
10)))\n(define w 9)")
+                (goto-char 5)
+                (geiser-stklos--get-module)))))
 
+;; Go to char in position 62. This is NOT inside a module, so :f should
+;; be returned.
+(ert-deftest get-module-2 ()
+  (should (eq :f
+              (with-temp-buffer
+                (insert "(define x 1)\n\n(define-library y (begin (define z 
10)))\n(define w 9)")
+                (goto-char 62)
+                (geiser-stklos--get-module)) )))
+
+;; Go to char in positions 19, 33 and 43. This is NOT inside a module, so :f 
should
+;; be returned.
+(ert-deftest get-module-3 ()
+  (should (eq 'y
+              (with-temp-buffer
+                (insert "(define x 1)\n\n(define-library y (begin (define z 
10)))\n(define w 9)")
+                (goto-char 19)
+                (geiser-stklos--get-module)))))
+
+(ert-deftest get-module-4 ()
+  (should (eq 'y
+              (with-temp-buffer
+                (insert "(define x 1)\n\n(define-library y (begin (define z 
10)))\n(define w 9)")
+                (goto-char 33)
+                (geiser-stklos--get-module)))))
+
+(ert-deftest get-module-5 ()
+  (should (eq 'y
+              (with-temp-buffer
+                (insert "(define x 1)\n\n(define-library y (begin (define z 
10)))\n(define w 9)")
+                (goto-char 43)
+                (geiser-stklos--get-module)))))
+
+(ert-deftest get-module-6 ()
+  (should (eq 'y
+              (with-temp-buffer
+                (insert "(define x 1)\n\n(define-module y  (define z 
10))\n(define w 9)")
+                (goto-char 29)
+                (geiser-stklos--get-module)))))
 
 ;; this one could have many more variants
 ;; Go to char in position 7 and find the beginning of the symbol
@@ -41,4 +87,29 @@
                (geiser-stklos--symbol-begin nil)))))
 
 
+(ert-deftest geiser-stklos--symbol-begin-2 ()
+  (should (= 14
+             (with-temp-buffer
+               (insert "(abc def (gh ijk () lmn))")
+               (goto-char 15)
+               (geiser-stklos--symbol-begin nil)))))
+
+(ert-deftest import-command ()
+  (let ((s (geiser-stklos--import-command "some-module")))
+    (should (and (stringp s)
+                 (string= s "(require \"some-module\")")))))
+
+(ert-deftest exit-command ()
+  (let ((s (geiser-stklos--exit-command)))
+    (should (and (stringp s)
+                 (string= s "(exit 0)")))))
+
+
+;; geiser-stklos-guess
+(ert-deftest guess ()
+  (should (eq nil
+              (with-temp-buffer
+                (insert "(let* ((let 'let) (let* let)) let)")
+                (goto-char 10)
+                (geiser-stklos--guess)))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]