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

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

[nongnu] elpa/geiser-kawa 56b7524 076/119: Add more elisp tests


From: Philip Kaludercic
Subject: [nongnu] elpa/geiser-kawa 56b7524 076/119: Add more elisp tests
Date: Sun, 1 Aug 2021 18:30:41 -0400 (EDT)

branch: elpa/geiser-kawa
commit 56b7524b714f0f57a4150a41f9b6c16afcfa42c3
Author: spellcard199 <spellcard199@protonmail.com>
Commit: spellcard199 <spellcard199@protonmail.com>

    Add more elisp tests
---
 elisp/tests/test-geiser-kawa.el | 63 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/elisp/tests/test-geiser-kawa.el b/elisp/tests/test-geiser-kawa.el
index dc5a5b9..00ad4ef 100644
--- a/elisp/tests/test-geiser-kawa.el
+++ b/elisp/tests/test-geiser-kawa.el
@@ -1,6 +1,14 @@
+;; Copyright (C) 2019, 2020 spellcard199 <spellcard199@protonmail.com>
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the Modified BSD License. You should
+;; have received a copy of the license along with this program. If
+;; not, see <http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5>.
+
 (require 'geiser)
 (require 'geiser-mode)
 (require 'geiser-kawa)
+(require 'gnus-util)
 
 (defun switch-to-and-reset-scratch-buffer()
   (switch-to-buffer "*scratch*")
@@ -11,9 +19,15 @@
  "run-kawa"
 
  (before-all
+
+  (print "[test-geiser-kawa.el] Running `mvnw package'...")
+
   (let ((mvn-buf (geiser-kawa-deps-mvn-package)))
     (while compilation-in-progress
       (sleep-for 0 250)))
+
+  (print "[test-geiser-kawa.el] `mvnw package' done.")
+
   (setq geiser-kawa-use-included-kawa t)
   (switch-to-and-reset-scratch-buffer)
   (run-kawa)
@@ -37,4 +51,53 @@
         (geiser-eval-buffer))
       :to-equal '((result "") (output . "foobar"))))
 
+ (it "can `geiser:autodoc'"
+     ;; TODO: How to test directly
+     ;; `geiser-autodoc--autodoc-at-point'?
+     ;; Always returns `nil' when run inside the tests.
+     (expect
+      (caar
+       (geiser-eval--send/result
+        (prin1-to-string
+         '(geiser:eval (interaction-environment)
+                       "(geiser:autodoc '(display))"))))
+      :to-equal "display"))
+
+ (it "can `macroexpand'"
+     (expect
+      (progn
+        (insert "(when #t 'foo 'bar)")
+        (goto-char (point-max))
+        (geiser-expand-last-sexp)
+        (geiser-debug--with-buffer
+          (buffer-substring-no-properties (point-min) (point-max))))
+      :to-equal "(if #t (begin (quote foo) (quote bar)))"))
+
+ (it "can `geiser:completions'"
+     (expect (geiser-completion--complete "dis" nil))
+     :to-equal '(display disassemble))
+
+ (it "can `geiser-kawa-devutil-complete--get-data'"
+     (expect
+      (cadr (assoc "completion-type"
+                   (geiser-kawa-devutil-complete--get-data
+                    "(java.lang.String:)" 18))))
+     :to-equal "METHODS")
+
+ (it "can `geiser-kawa-devutil-exprtree--for-expression'"
+     (expect
+      (string-suffix-p "SimpleSymbol)))"
+                       (geiser-kawa-devutil-exprtree--for-expression
+                        "(display 'foobar)")))
+     :to-equal t)
+
+ (it "can `geiser-kawa-devutil-complete--exprtree'"
+     (expect
+      (string-prefix-p "(Module"
+                       (geiser-kawa-devutil-complete--exprtree
+                        "(java.lang.String:)" 18)))
+     :to-equal t)
+
  )
+
+;;; test-geiser-kawa.el ends here



reply via email to

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