From: Aaron Jensen <aaronjensen@gmail.com>
To: 45748@debbugs.gnu.org
Cc: contovob@tcd.ie, Aaron Jensen <aaronjensen@gmail.com>
Subject: bug#45748: [PATCH] * test/src/xdisp-tests.el Fix tests to work in batch mode
Date: Sat, 16 Jan 2021 12:24:53 -0600 [thread overview]
Message-ID: <20210116182453.2961-2-aaronjensen@gmail.com> (raw)
In-Reply-To: <20210116182453.2961-1-aaronjensen@gmail.com>
(xdisp-tests--window-text-pixel-size)
(xdisp-tests--window-text-pixel-size-leading-space)
(xdisp-tests--window-text-pixel-size-trailing-space): Fix tests
---
test/src/xdisp-tests.el | 42 ++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/test/src/xdisp-tests.el b/test/src/xdisp-tests.el
index ec96d777ff..637cc796a3 100644
--- a/test/src/xdisp-tests.el
+++ b/test/src/xdisp-tests.el
@@ -73,33 +73,33 @@ xdisp-tests--minibuffer-scroll
(should (equal (nth 1 posns) (nth 2 posns)))))
(ert-deftest xdisp-tests--window-text-pixel-size () ;; bug#45748
- (with-temp-buffer
+ (with-current-buffer (generate-new-buffer "*test*")
(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)))
+ (kill-buffer)
+ (should (equal width-in-chars 3)))))
(ert-deftest xdisp-tests--window-text-pixel-size-leading-space () ;; bug#45748
- (with-temp-buffer
+ (with-current-buffer (generate-new-buffer "*test*")
(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)))
+ (kill-buffer)
+ (should (equal width-in-chars 3)))))
(ert-deftest xdisp-tests--window-text-pixel-size-trailing-space () ;; bug#45748
- (with-temp-buffer
+ (with-current-buffer (generate-new-buffer "*test*")
(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)))
+ (kill-buffer)
+ (should (equal width-in-chars 3)))))
;;; xdisp-tests.el ends here
--
2.28.0
next prev parent reply other threads:[~2021-01-16 18:24 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-09 15:43 bug#45748: 28.0.50; fit-frame-to-buffer ignores leading spaces Aaron Jensen
2021-01-09 15:57 ` Aaron Jensen
2021-01-09 16:27 ` Aaron Jensen
2021-01-09 17:07 ` martin rudalics
2021-01-09 17:44 ` Aaron Jensen
2021-01-09 17:55 ` Aaron Jensen
2021-01-09 18:14 ` Eli Zaretskii
2021-01-10 2:56 ` Aaron Jensen
2021-01-10 16:05 ` martin rudalics
2021-01-10 17:31 ` Aaron Jensen
2021-01-10 17:49 ` martin rudalics
2021-01-10 17:51 ` Aaron Jensen
2021-01-10 17:57 ` martin rudalics
2021-01-10 17:58 ` Aaron Jensen
2021-01-13 4:34 ` Aaron Jensen
2021-01-13 14:26 ` Eli Zaretskii
2021-01-15 12:11 ` Eli Zaretskii
2021-01-15 12:34 ` Aaron Jensen
2021-01-15 13:15 ` Eli Zaretskii
2021-01-15 14:04 ` Aaron Jensen
2021-01-15 15:37 ` Eli Zaretskii
2021-01-15 17:03 ` Aaron Jensen
2021-01-09 18:03 ` Eli Zaretskii
2021-01-09 17:44 ` Eli Zaretskii
2021-01-09 17:49 ` Aaron Jensen
2021-01-09 17:07 ` martin rudalics
2021-01-16 17:12 ` bug#45748: [PATCH] * test/src/xdisp-tests.el Fix tests to work in batch mode Aaron Jensen
2021-01-16 17:57 ` Basil L. Contovounesios
2021-01-16 18:24 ` Aaron Jensen
2021-01-16 18:24 ` Aaron Jensen [this message]
2021-01-16 18:28 ` Aaron Jensen
2021-01-16 18:28 ` Aaron Jensen
2021-01-16 18:33 ` Eli Zaretskii
2021-01-18 17:04 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210116182453.2961-2-aaronjensen@gmail.com \
--to=aaronjensen@gmail.com \
--cc=45748@debbugs.gnu.org \
--cc=contovob@tcd.ie \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.