emacs-diffs
[Top][All Lists]
Advanced

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

master c4be126 1/2: * test/src/xdisp-tests.el: Fix tests to work in batc


From: Eli Zaretskii
Subject: master c4be126 1/2: * test/src/xdisp-tests.el: Fix tests to work in batch mode
Date: Mon, 18 Jan 2021 12:03:44 -0500 (EST)

branch: master
commit c4be126c42600990375720511326c5ab8fb22a84
Author: Aaron Jensen <aaronjensen@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>

    * test/src/xdisp-tests.el: Fix tests to work in batch mode
    
    (xdisp-tests--window-text-pixel-size)
    (xdisp-tests--window-text-pixel-size-leading-space)
    (xdisp-tests--window-text-pixel-size-trailing-space): Fix tests.
    (Bug#45748)
---
 test/src/xdisp-tests.el | 33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/test/src/xdisp-tests.el b/test/src/xdisp-tests.el
index ec96d77..4e7d2ad 100644
--- a/test/src/xdisp-tests.el
+++ b/test/src/xdisp-tests.el
@@ -75,31 +75,28 @@
 (ert-deftest xdisp-tests--window-text-pixel-size () ;; bug#45748
   (with-temp-buffer
     (insert "xxx")
-    (let* ((window
-            (display-buffer (current-buffer) '(display-buffer-in-child-frame . 
nil)))
-          (char-width (frame-char-width))
-          (size (window-text-pixel-size nil t t)))
-      (delete-frame (window-frame window))
-      (should (equal (/ (car size) char-width) 3)))))
+    (switch-to-buffer (current-buffer))
+    (let* ((char-width (frame-char-width))
+           (size (window-text-pixel-size nil t t))
+           (width-in-chars (/ (car size) char-width)))
+      (should (equal width-in-chars 3)))))
 
 (ert-deftest xdisp-tests--window-text-pixel-size-leading-space () ;; bug#45748
   (with-temp-buffer
     (insert " xx")
-    (let* ((window
-            (display-buffer (current-buffer) '(display-buffer-in-child-frame . 
nil)))
-          (char-width (frame-char-width))
-          (size (window-text-pixel-size nil t t)))
-      (delete-frame (window-frame window))
-      (should (equal (/ (car size) char-width) 3)))))
+    (switch-to-buffer (current-buffer))
+    (let* ((char-width (frame-char-width))
+           (size (window-text-pixel-size nil t t))
+           (width-in-chars (/ (car size) char-width)))
+      (should (equal width-in-chars 3)))))
 
 (ert-deftest xdisp-tests--window-text-pixel-size-trailing-space () ;; bug#45748
   (with-temp-buffer
     (insert "xx ")
-    (let* ((window
-            (display-buffer (current-buffer) '(display-buffer-in-child-frame . 
nil)))
-          (char-width (frame-char-width))
-          (size (window-text-pixel-size nil t t)))
-      (delete-frame (window-frame window))
-      (should (equal (/ (car size) char-width) 3)))))
+    (switch-to-buffer (current-buffer))
+    (let* ((char-width (frame-char-width))
+           (size (window-text-pixel-size nil t t))
+           (width-in-chars (/ (car size) char-width)))
+      (should (equal width-in-chars 3)))))
 
 ;;; xdisp-tests.el ends here



reply via email to

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