Subject: bug#75648: Minor safety improvements to fns.c/eval.c

From: Stefan Kangas <[email-masked]>
Date: Sat, 18 Jan 2025 17:30:54 -0600

Pip Cet <[email-masked]> writes:

> "Eli Zaretskii" <[email-masked]> writes:
>
>>> Patch 1 adds :crash tests to ert.el.
>>
>> Hmm... maybe this should be discussed separately, as it's a much
>> broader issue.  Can you provide the motivation, both for the new macro
>> (which is basically a one-liner), and for the new tag?
>>
>> I've added some people to the discussion, because of this particular
>> part (maybe we should take this part to a separate thread).
>
> Responding separately to these two issues.  If we need a new bug number,
> please let me know.  This is the ERT response.
>
> Summary: Some bugs cause Emacs to crash.  We'd like to introduce
> regression tests so the crashes, once fixed, won't reappear.  However,
> if they do, ERT currently makes it hard to find out which test failed.
> Also, these cases are usually such strange things for Elisp to do that
> that it's perfectly okay for behavior to be undefined or change: we
> don't want to test a return value using (should) or (should-not), and we
> want to permit errors but not require them.

I assume that the justification for the new :crash property is improved
display of the test result.  Is that right?  If so, I think it would be
useful to see an example excerpt of the output in case a test crashes
Emacs before and after this patch.

The patch that fixes the bug LGTM, but I see that Eli had a suggestion
for how to improve things even further.

Thanks for working on this.