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

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

[nongnu] elpa/popup a3d1bfd 112/184: Fix test.


From: ELPA Syncer
Subject: [nongnu] elpa/popup a3d1bfd 112/184: Fix test.
Date: Wed, 6 Oct 2021 00:01:23 -0400 (EDT)

branch: elpa/popup
commit a3d1bfd549a922aa00a362aa4501a3bb494e66d5
Author: TAKAGI Kentaro <kentaro0910+git@gmail.com>
Commit: TAKAGI Kentaro <kentaro0910+git@gmail.com>

    Fix test.
---
 tests/popup-test.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/popup-test.el b/tests/popup-test.el
index bfc19c7..caf22b4 100644
--- a/tests/popup-test.el
+++ b/tests/popup-test.el
@@ -5,6 +5,11 @@
 (when (< (frame-width) (length "long long long long line"))
   (set-frame-size (selected-frame) 80 35))
 
+(defun popup-test-helper-posn-col-row (dummy)
+  "This function is workaround. Because `posn-col-row' and `posn-at-point'
+can not work well in batch mode."
+  (cons (current-column) (line-number-at-pos (point))))
+
 (defmacro popup-test-with-common-setup (&rest body)
   (declare (indent 0) (debug t))
   `(save-excursion
@@ -12,8 +17,11 @@
        (switch-to-buffer (current-buffer))
        (delete-other-windows)
        (erase-buffer)
-       ,@body
-       )))
+       (if noninteractive
+           (cl-letf (((symbol-function 'posn-col-row)
+                      #'popup-test-helper-posn-col-row))
+             ,@body)
+         ,@body))))
 
 (defun popup-test-helper-line-move-visual (arg)
   "This function is workaround. Because `line-move-visual' can not work well in



reply via email to

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