From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs 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 Message-ID: <20210116182453.2961-2-aaronjensen@gmail.com> References: <20210116182453.2961-1-aaronjensen@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28687"; mail-complaints-to="usenet@ciao.gmane.io" Cc: contovob@tcd.ie, Aaron Jensen To: 45748@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 16 19:26:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l0qH5-0007Mn-Eu for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Jan 2021 19:26:11 +0100 Original-Received: from localhost ([::1]:60738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0qH4-0000h5-Ag for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Jan 2021 13:26:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0qGx-0000gl-0C for bug-gnu-emacs@gnu.org; Sat, 16 Jan 2021 13:26:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60683) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l0qGw-00037v-PB for bug-gnu-emacs@gnu.org; Sat, 16 Jan 2021 13:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l0qGw-0002G1-Lx for bug-gnu-emacs@gnu.org; Sat, 16 Jan 2021 13:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jan 2021 18:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45748 X-GNU-PR-Package: emacs Original-Received: via spool by 45748-submit@debbugs.gnu.org id=B45748.16108215288631 (code B ref 45748); Sat, 16 Jan 2021 18:26:02 +0000 Original-Received: (at 45748) by debbugs.gnu.org; 16 Jan 2021 18:25:28 +0000 Original-Received: from localhost ([127.0.0.1]:43995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0qGO-0002F9-7n for submit@debbugs.gnu.org; Sat, 16 Jan 2021 13:25:28 -0500 Original-Received: from mail-io1-f41.google.com ([209.85.166.41]:33220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0qGM-0002Et-IO for 45748@debbugs.gnu.org; Sat, 16 Jan 2021 13:25:26 -0500 Original-Received: by mail-io1-f41.google.com with SMTP id w18so24783632iot.0 for <45748@debbugs.gnu.org>; Sat, 16 Jan 2021 10:25:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dTc84uxiqxQ4g4Z03v77YqpS27vGE4UXxpHTKiojvZE=; b=grIUJ8D8tUA/3APuaNcjPdtosv1RdL6eg9W2WvD4uXIeIvhtXJwTpU5oOvP3EA1lIc ufTOUXfAQL6BFcfBm27Q+Ya3VdQ5rvTFKPG6Y7oWMpZJVECK01kx+v22el7zYmjDllGs ai9iY1NS2ht8faHe3qfazHCv4+Ng0vorgbIhSgFfcZdfUYKDCZq7N8mcsenXC8n7W5du tvjrBHU0wlN7/jbO6r4S3sbJdf1t9m7m4JLmClK1lFzrRB1lLJexNTzFFNVRlPKOac/k Kc/8Aq2n6ASMLYBRXU+tX8uDl49dkxrjeWKIabBlelUoaAk8T12gIxcYWPfhZjhhqqs0 JyfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dTc84uxiqxQ4g4Z03v77YqpS27vGE4UXxpHTKiojvZE=; b=mV12oXsr5E+ihCMfBBvQ7xOWbCH7UulOa/Oqz5kFUBtXYHFfuPWTerQEkj8qOr1XSl Bc3pJLudh8/uU2ofpdADf0XLKoaYvZiw1MfNokMDCpLplWew0zfbIV81Iiq+cYJRJtSW yPkoLP1myYPMC9ajUe29pylqrWbRWvudS0NWmmXXAlB5HuWzlmKr0rQIAnKIVRSh+qIf x+72uCMZipc1ZnzGCClKX1sxpzflKUXBK4onA278wur5moL5EMhrzIiG+jtRbNuLL1SB 5hgVAw0tm21LxTYWs2Wjy4FinRh1bvTuLpNCYhSzwE8FvZarmAW3mfAydJQ8uSFnd9ch F9Lw== X-Gm-Message-State: AOAM530dFhLnmSJfcqFsaZeH6Vky+FOPNHfPsp/1Z7ghYB+NfX4XXpve rPa+XfHKnx5qLPCdKNyGOJQ6pnYVKs9AHg== X-Google-Smtp-Source: ABdhPJx4WA13JZNL70DpcskvB7pFwBTqSS9SZq930YwIzhWnj0HjQ0tb16e7r3Dt6hOjfndHfgsbNg== X-Received: by 2002:a02:91c2:: with SMTP id s2mr15407755jag.48.1610821520947; Sat, 16 Jan 2021 10:25:20 -0800 (PST) Original-Received: from localhost.localdomain ([205.214.166.193]) by smtp.gmail.com with ESMTPSA id s8sm5978809ilv.76.2021.01.16.10.25.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Jan 2021 10:25:20 -0800 (PST) X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210116182453.2961-1-aaronjensen@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:198030 Archived-At: (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