Subject: 29.0.50; Basic erts functionality seems to be broken

From: akater <[email-masked]>
Date: Tue, 26 Oct 2021 11:09:58 +0000

I can't make some basic erts tests work; this looks like an erts bug.

In the following file, the specified result of the first test is what
you'd see in a emacs-lisp-mode buffer.  When the test is run, you don't
get this result.

Furthermore, load the following file in emacs -Q and run
(ert-run-tests-interactively t).  I observe, on the recent build from
master, that the /resulting/ after- string is different depending on
what the /specified/ after- string was, which certainly should not
happen.

This is true in two instances of Emacs built with vastly different
settings so I omitted Emacs build details.

;;; -*- lexical-binding: t; -*-

(require 'ert)
(require 'ert-x)

(with-current-buffer (find-file-noselect "/tmp/erts-tests.erts")
  (erase-buffer)
  (insert
   "Name: erts-with-basic-newline
Code: (lambda () (emacs-lisp-mode) (newline nil t))
Point-Char: |
No-Before-Newline: t
No-After-Newline: t

=-=
(whatever|
=-=
(whatever
 |
=-=-=
")
  (save-buffer))

(ert-deftest my-erts-tests ()
  (ert-test-erts-file (ert-resource-file "/tmp/erts-tests.erts")))

(with-current-buffer (find-file-noselect "/tmp/erts-tests-with-garbage.erts")
  (erase-buffer)
  (insert
   "Name: erts-with-basic-newline-and-garbabe
Code: (lambda () (emacs-lisp-mode) (newline nil t))
Point-Char: |
No-Before-Newline: t
No-After-Newline: t

=-=
(whatever|
=-=
(whatever
should-not-be-here |
=-=-=
")
  (save-buffer))

(ert-deftest my-erts-tests-with-garbage ()
  (ert-test-erts-file (ert-resource-file "/tmp/erts-tests-with-garbage.erts")))