unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: 66042@debbugs.gnu.org
Cc: Lei Zhu <julytreee@gmail.com>
Subject: bug#66042: 30.0.50; ERT test fails while trying to indent pretty-print
Date: Mon, 18 Sep 2023 06:30:24 -0300	[thread overview]
Message-ID: <20ab56a8-4a76-792b-2159-66d9f81718a0@gmail.com> (raw)
In-Reply-To: <87msxkcc7x.fsf@protesilaos.com>

On 18/9/23 01:54, Protesilaos Stavrou wrote:
 > Hello Stefan, Mauro,
 >
 >> From: Stefan Kangas <stefankangas@gmail.com>
 >> Date: Sun, 17 Sep 2023 04:47:29 -0700
 >
 >> [... 20 lines elided]
 >
 >> I can't reproduce this on current master.  Evaluating the above two
 >> forms in emacs -Q and then saying
 >
 >> [... 23 lines elided]
 >
 >> Which version of Emacs are you running?
 >>
 >> Can you reproduce it in emacs -Q?
 >
 > Yes, I can reproduce it with 'emacs -Q' on Emacs trunk.  I tried it just
 > now with the following code.  See attached screenshot.
 >
 >      (require 'ert)
 >
 >      (defun ert--pp-with-indentation-and-newline (object)
 >        "Pretty-print OBJECT, indenting it to the current column of point.
 >      Ensures a final newline is inserted."
 >        (let ((begin (point))
 >              (pp-escape-newlines t)
 >              (print-escape-control-characters t))
 >          (pp object (current-buffer))
 >          (unless (bolp) (insert "\n"))
 >          (save-excursion
 >            (goto-char begin)
 >            (indent-sexp)
 >            )))
 >
 >      (ert-deftest my-kill-backward-test-close-parens ()
 >        "aaa)))"
 >        (test-case "aaa)))" 7 "aaa"))
 >
 >      (defun test-case (text pos expected)
 >        (with-temp-buffer
 >          (insert text)
 >          (goto-char pos)
 >          (backward-kill-word 1)
 >          (should (string-equal (buffer-string) expected))))
 >

I can reproduce it now.  Your original recipe didn't include a docstring
for the ERT test.







      reply	other threads:[~2023-09-18  9:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-17  6:13 bug#66042: 30.0.50; ERT test fails while trying to indent pretty-print Protesilaos Stavrou
2023-09-17 11:46 ` Mauro Aranda
2023-09-17 11:47 ` Stefan Kangas
2023-09-18  4:54   ` Protesilaos Stavrou
2023-09-18  9:30     ` Mauro Aranda [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20ab56a8-4a76-792b-2159-66d9f81718a0@gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=66042@debbugs.gnu.org \
    --cc=julytreee@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).