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

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

[nongnu] elpa/popup 4a31175 033/184: Split setup macro to support extra


From: ELPA Syncer
Subject: [nongnu] elpa/popup 4a31175 033/184: Split setup macro to support extra setup
Date: Wed, 6 Oct 2021 00:01:01 -0400 (EDT)

branch: elpa/popup
commit 4a31175bf755e33ba9d92d0fd9d8ac9114d5bcce
Author: yuuki arisawa <yuuki.ari@gmail.com>
Commit: yuuki arisawa <yuuki.ari@gmail.com>

    Split setup macro to support extra setup
---
 tests/popup-test.el | 36 ++++++++++++++++++++++++++++++++----
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/tests/popup-test.el b/tests/popup-test.el
index 480c7d6..399493a 100644
--- a/tests/popup-test.el
+++ b/tests/popup-test.el
@@ -6,15 +6,28 @@
 
 (set-default 'truncate-lines t)
 
-(defmacro popup-test-with-common-setup (&rest body)
+(defmacro popup-test-with-create-popup (&rest body)
+  (declare (indent 0) (debug t))
+  `(let ((popup (popup-create (point) 10 10)))
+     (unwind-protect
+         (progn ,@body)
+       (when ac-menu
+         (popup-delete popup)))
+     ))
+
+(defmacro popup-test-with-temp-buffer (&rest body)
   (declare (indent 0) (debug t))
   `(save-excursion
      (with-temp-buffer
        (switch-to-buffer (current-buffer))
        (erase-buffer)
-       (let ((popup (popup-create (point) 10 10)))
-         ,@body
-         (popup-delete popup)))))
+       ,@body
+       )))
+
+(defmacro popup-test-with-common-setup (&rest body)
+  (declare (indent 0) (debug t))
+  `(popup-test-with-temp-buffer
+     (popup-test-with-create-popup ,@body)))
 
 (defun popup-test-helper-get-overlays-buffer ()
   "Create a new buffer called *text* containing the visible text
@@ -126,3 +139,18 @@ HELP-DELAY is a delay of displaying helps."
         (should (popup-test-helper-same-all-p
                  (popup-test-helper-points-to-column points) 0)))
       )))
+
+(ert-deftest popup-test-culumn ()
+  (popup-test-with-temp-buffer
+    (insert " ")
+    (popup-test-with-create-popup
+      (popup-set-list popup '("foo" "bar" "baz"))
+      (popup-draw popup)
+      (should (equal (popup-list popup) '("foo" "bar" "baz")))
+      (with-current-buffer (popup-test-helper-get-overlays-buffer)
+        (let ((points (popup-test-helper-match-points '("foo" "bar" "baz"))))
+          (should (every #'identity points))
+          (should (equal (popup-test-helper-points-to-column points) '(1 1 1)))
+          (should (eq (popup-test-helper-same-all-p
+                       (popup-test-helper-points-to-column points)) 1)))
+        ))))



reply via email to

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