GNU bug report logs -
#66042
30.0.50; ERT test fails while trying to indent pretty-print
Previous Next
Full log
Message #19 received at 66042 <at> debbugs.gnu.org (full text, mbox):
On 18/9/23 01:54, Protesilaos Stavrou wrote:
> Hello Stefan, Mauro,
>
>> From: Stefan Kangas <stefankangas <at> 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.
This bug report was last modified 1 year and 271 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.