[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/popup e995ffa 030/184: Add check for columns of starting p
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/popup e995ffa 030/184: Add check for columns of starting points. |
Date: |
Wed, 6 Oct 2021 00:01:01 -0400 (EDT) |
branch: elpa/popup
commit e995ffa711834401886c12c4c7f67da9008786e0
Author: yuuki arisawa <yuuki.ari@gmail.com>
Commit: yuuki arisawa <yuuki.ari@gmail.com>
Add check for columns of starting points.
---
tests/popup-test.el | 32 +++++++++++++++++++++++---------
1 file changed, 23 insertions(+), 9 deletions(-)
diff --git a/tests/popup-test.el b/tests/popup-test.el
index 70cf6e0..0d6c75a 100644
--- a/tests/popup-test.el
+++ b/tests/popup-test.el
@@ -49,13 +49,24 @@ into real text."
(insert x)
(buffer-string)))))
-(defun popup-test-helper-match-contents (contents)
+(defun popup-test-helper-match-points (contents)
+ "Return list of start of first match"
(if (listp contents)
(mapcar (lambda (content)
(string-match content
(popup-test-helper-overlays-to-text)))
contents)))
+(defun popup-test-helper-points-to-column (points)
+ (mapcar
+ (lambda (point)
+ (save-excursion (goto-char point) (current-column)))
+ points))
+
+(defun popup-test-helper-same-all-p (columns &optional value)
+ (let ((res (reduce #'(lambda (x y) (if (eq x y) x nil)) columns)))
+ (if value (eq res value) res)))
+
(defun popup-test-helper-input (key)
(push key unread-command-events))
@@ -64,9 +75,10 @@ into real text."
(popup-set-list popup '("foo" "bar" "baz"))
(popup-draw popup)
(should (equal (popup-list popup) '("foo" "bar" "baz")))
- (should (every #'identity
- (popup-test-helper-match-contents '("foo" "bar" "baz"))))
- ))
+ (let ((points (popup-test-helper-match-points '("foo" "bar" "baz"))))
+ (should (every #'identity points))
+ (should (popup-test-helper-same-all-p
+ (popup-test-helper-points-to-column points) 0)))))
(ert-deftest popup-test-delete ()
(popup-test-with-common-setup
@@ -80,7 +92,7 @@ into real text."
(popup-hide popup)
(should (equal (popup-list popup) '("foo" "bar" "baz")))
(should-not (every #'identity
- (popup-test-helper-match-contents '("foo" "bar"
"baz"))))
+ (popup-test-helper-match-points '("foo" "bar" "baz"))))
))
(ert-deftest popup-test-tip ()
@@ -101,8 +113,10 @@ canceled. The arguments is whole filtered list of items.
HELP-DELAY is a delay of displaying helps."
:nowait t)
- (should
- (every #'identity
- (popup-test-helper-match-contents
- '("CURSOR-COLOR is a cursor color during isearch"))))
+ (let ((points (popup-test-helper-match-points
+ '("CURSOR-COLOR is a cursor color during isearch"
+ "KEYMAP is a keymap"))))
+ (should (every #'identity points))
+ (should (popup-test-helper-same-all-p
+ (popup-test-helper-points-to-column points) 0)))
))
- [nongnu] elpa/popup 4e19acb 036/184: Remove dependency on auto-complete, (continued)
- [nongnu] elpa/popup 4e19acb 036/184: Remove dependency on auto-complete, ELPA Syncer, 2021/10/06
- [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 <=
- [nongnu] elpa/popup 8d7e57e 065/184: Replace popup-test-with-create-popup to popup-create, ELPA Syncer, 2021/10/06
- [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