[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/popup 8d7e57e 065/184: Replace popup-test-with-create-popu
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/popup 8d7e57e 065/184: Replace popup-test-with-create-popup to popup-create |
Date: |
Wed, 6 Oct 2021 00:01:08 -0400 (EDT) |
branch: elpa/popup
commit 8d7e57ec287e19088589b12bef7a63574dca2de3
Author: uk-ar <yuuki.ari@gmail.com>
Commit: uk-ar <yuuki.ari@gmail.com>
Replace popup-test-with-create-popup to popup-create
---
tests/popup-test.el | 47 +++++++++++++++++++----------------------------
1 file changed, 19 insertions(+), 28 deletions(-)
diff --git a/tests/popup-test.el b/tests/popup-test.el
index 4dda31f..a832687 100644
--- a/tests/popup-test.el
+++ b/tests/popup-test.el
@@ -7,15 +7,6 @@
(when (< (frame-width) (length "long long long long line"))
(set-frame-size (selected-frame) 80 35))
-(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 popup
- (popup-delete popup)))
- ))
-
(defmacro popup-test-with-temp-buffer (&rest body)
(declare (indent 0) (debug t))
`(save-excursion
@@ -26,11 +17,6 @@
,@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
of the current buffer, ie. it converts overlays containing text
@@ -118,8 +104,11 @@ into real text. Return *text* buffer"
)
;; Test for popup-el
+(defvar popup nil)
+
(ert-deftest popup-test-simple ()
- (popup-test-with-common-setup
+ (popup-test-with-temp-buffer
+ (setq popup (popup-create (point) 10 10))
(popup-set-list popup '("foo" "bar" "baz"))
(popup-draw popup)
(should (equal (popup-list popup) '("foo" "bar" "baz")))
@@ -131,12 +120,14 @@ into real text. Return *text* buffer"
(popup-test-helper-points-to-columns points)) 0))))))
(ert-deftest popup-test-delete ()
- (popup-test-with-common-setup
+ (popup-test-with-temp-buffer
+ (setq popup (popup-create (point) 10 10))
(popup-delete popup)
(should-not (popup-live-p popup))))
(ert-deftest popup-test-hide ()
- (popup-test-with-common-setup
+ (popup-test-with-temp-buffer
+ (setq popup (popup-create (point) 10 10))
(popup-set-list popup '("foo" "bar" "baz"))
(popup-draw popup)
(popup-hide popup)
@@ -176,17 +167,17 @@ HELP-DELAY is a delay of displaying helps."
(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-columns points)
- '(1 1 1)))
- )
- ))))
+ (setq popup (popup-create (point) 10 10))
+ (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-columns points)
+ '(1 1 1)))
+ )
+ )))
(ert-deftest popup-test-folding-long-line-right-top ()
(popup-test-with-temp-buffer
- [nongnu] elpa/popup bec50cc 076/184: Merge pull request #41 from kostafey/master, (continued)
- [nongnu] elpa/popup bec50cc 076/184: Merge pull request #41 from kostafey/master, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 4e8824e 051/184: Add some make rules for test., ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup f2fc154 058/184: Add summary-face keyword argument to popup-create-line-string, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup b45aa2d 060/184: Handle summary-face in popup-draw, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup e645eae 049/184: Add test case:popup-scroll-down, popup-scroll-up, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup ee5b4b0 034/184: Add test case when point is on the corner, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 1d692e4 066/184: Replace helper functions for some tests., ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 25e2e7f 043/184: Merge pull request #17 from uk-ar/feature, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 9dcce09 024/184: Merge branch 'master' of github.com:auto-complete/popup-el, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup e995ffa 030/184: Add check for columns of starting points., ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 8d7e57e 065/184: Replace popup-test-with-create-popup to popup-create,
ELPA Syncer <=
- [nongnu] elpa/popup 357f037 045/184: Add test case:popup-tip(height), ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup b8c1cb4 054/184: At least one space before summary, if possible, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 7533efe 078/184: Merge pull request #53 from auto-complete/fix-travis, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 64102c2 046/184: Add test case:popup-tip(scroll-bar, min-height), ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 487c0a8 109/184: add :initial-index parameter test, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 8719cd9 105/184: Merge pull request #71 from auto-complete/use-cask, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 1510820 100/184: activate isearch in cascade menu, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 58f55de 096/184: Merge pull request #62 from auto-complete/support-max-width, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup afeaed3 082/184: Merge branch 'master' into use-cl-lib, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 70c2583 093/184: Add 'nostrip' parameter explanation to docstring, ELPA Syncer, 2021/10/06