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

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

[nongnu] elpa/popup 357f037 045/184: Add test case:popup-tip(height)


From: ELPA Syncer
Subject: [nongnu] elpa/popup 357f037 045/184: Add test case:popup-tip(height)
Date: Wed, 6 Oct 2021 00:01:03 -0400 (EDT)

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

    Add test case:popup-tip(height)
---
 tests/popup-test.el | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/tests/popup-test.el b/tests/popup-test.el
index 53ce80b..0fb85ec 100644
--- a/tests/popup-test.el
+++ b/tests/popup-test.el
@@ -251,3 +251,26 @@ HELP-DELAY is a delay of displaying helps."
           (should (equal (car (popup-test-helper-points-to-columns points))
                          0))
           )))))
+
+(ert-deftest popup-test-two-lines ()
+  (popup-test-with-temp-buffer
+    (let ((popup (popup-tip "Foo\nBar\nBaz" :nowait t :height 2)))
+      (with-current-buffer (popup-test-helper-get-overlays-buffer)
+        (let ((points (popup-test-helper-match-points '("Foo" "Bar" "Baz"))))
+          (should (equal points '(2 6 nil)))
+          (should (equal (popup-test-helper-points-to-columns points)
+                         '(0 0 nil)))
+          (should (eq (line-number-at-pos (car points)) 2))
+          )))))
+
+(ert-deftest popup-test-two-lines-bottom ()
+  (popup-test-with-temp-buffer
+    (insert (make-string (- (window-body-height) 1) ?\n))
+    (let ((popup (popup-tip "Foo\nBar\nBaz" :nowait t :height 2)))
+      (with-current-buffer (popup-test-helper-get-overlays-buffer)
+        (let ((points (popup-test-helper-match-points '("Foo" "Bar" "Baz"))))
+          (should (equal (popup-test-helper-points-to-columns points)
+                         '(0 0 nil)))
+          (should (eq (line-number-at-pos (car points))
+                      (- (window-body-height) 2)))
+          )))))



reply via email to

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