I kinda doubt it is worth it. There are currently no savehist tests at all that I can see. But if you really, really want one, I'll start a test jig.

On Fri, Feb 7, 2025 at 3:45 PM Stefan Kangas <stefankangas@gmail.com> wrote:
Ship Mints <shipmints@gmail.com> writes:

> This patch avoids savehist saving symbols duplicated between
> 'savehist-minibuffer-history-variables' and
> 'savehist-additional-variables'. I've accumulated symbols on
> 'savehist-additional-variables' that wind up, over time, in the master
> minibuffer list documented as being dynamic.
>
>   The contents of this variable is built while Emacs is running,
>   and saved along with minibuffer history.
>
> savehist had no defensive mechanism until now. The patch should do no harm
> to users and will transparently save some resources.

Would it be worth adding a test for this?