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

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

[nongnu] elpa/popup a33775f 047/184: Add test case:popup-menu*, popup-ca


From: ELPA Syncer
Subject: [nongnu] elpa/popup a33775f 047/184: Add test case:popup-menu*, popup-cascade-menu
Date: Wed, 6 Oct 2021 00:01:04 -0400 (EDT)

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

    Add test case:popup-menu*,popup-cascade-menu
---
 tests/popup-test.el | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/tests/popup-test.el b/tests/popup-test.el
index c346edc..66716cf 100644
--- a/tests/popup-test.el
+++ b/tests/popup-test.el
@@ -347,3 +347,32 @@ HELP-DELAY is a delay of displaying helps."
           (should (eq (nth 1 (popup-test-helper-points-to-columns last-bounds))
                       (1- (window-width))))
           )))))
+
+(ert-deftest popup-test-menu ()
+  (popup-test-with-temp-buffer
+    (let ((popup (popup-menu* '("Foo" "Bar" "Baz") :nowait t)))
+      (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 (eq (line-number-at-pos (car points)) 2))
+          (should (equal (popup-test-helper-points-to-columns points)
+                         '(0 0 0)))
+          )))))
+
+(ert-deftest popup-test-cascade-menu ()
+  (popup-test-with-temp-buffer
+    (let ((popup (popup-cascade-menu
+                  '(("Foo" "Foo1" "Foo2") "Bar" "Baz") :nowait t :margin t)))
+      (should (string= (car (popup-list popup)) "Foo"))
+      (should (equal (popup-item-sublist (car (popup-list popup)))
+                     '("Foo1" "Foo2")))
+      (should (equal (popup-item-symbol (car (popup-list popup))) ">"))
+      (should (equal (cdr (popup-list popup)) '("Bar" "Baz")))
+      (with-current-buffer (popup-test-helper-get-overlays-buffer)
+        (let ((points (popup-test-helper-match-points
+                       '("Foo" "Bar" "Baz" "Foo1"))))
+          (should (eq (line-number-at-pos (car points)) 2))
+          (should (equal (popup-test-helper-points-to-columns points)
+                         '(0 0 0 nil)))
+          )))))



reply via email to

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