Subject: Re: bug#79027: xref/pp changes in latest versions?

From: Gonzalo Larumbe <[email-masked]>
Date: Wed, 16 Jul 2025 15:57:56 +0200

I guess it was the default behaviour of the package to take them into
account but it should not be a problem at all to ignore them for testing.

I just tried removing text properties and text file comparison now works.

Thanks a lot for your quick help!

El mié, 16 jul 2025 a las 15:29, Eli Zaretskii (<[email-masked]>) escribió:

> > From: Gonzalo Larumbe <[email-masked]>
> > Date: Wed, 16 Jul 2025 14:54:29 +0200
> > Cc: [email-masked]
> >
> > The test compares a reference text file generated beforehand using
> `xref` and `pp` (e.g.
> >
> https://github.com/gmlarumbe/verilog-ext/blob/main/test/ref/xref/ucontroller.xref.defs.el)
> with a text file
> > generated during the test.
> >
> > Reference files and current test files are generated using the function
> `test-hdl-process-file-fn`:
> > - Line 84 @
> >
> https://github.com/gmlarumbe/test-hdl/blob/86ed7f9dcb0d0697e6b7ce0a64d82b7245cfade9/test-hdl-common.el
> >
> >
> > This particular xref test compares a list of xref objects gathered from
> a Verilog file using the following test
> > function:
> > (cl-defun verilog-ext-test-xref-fn (&key refs type)
> >   (let (ret-val)
> >     (dolist (ref refs (nreverse ret-val))
> >       (push (verilog-ext-xref--find-symbol ref type) ret-val))))
> >
> > The function `verilog-ext-xref--find-symbol` returns a list of
> `xref-items` with their respective
> > `xref-file-locations` from a hash-table created previously by parsing
> the file using tree-sitter.
> > - Line 40 @
> https://github.com/gmlarumbe/verilog-ext/blob/main/verilog-ext-xref.el
> >
> > This list is pretty printed to a file using `pp-29` as
> `pp-default-function` for compatibility in tests between
> > Emacs 29 and 30.
> >
> > Use of font-lock to have a list of fontified xref matches is
> customizable. In this case the files are parsed and
> > `font-lock-ensure` is run. This did not seem to be a problem and the
> behaviour is the same for versions from
> > 29.1 to 30.1.
> >
> > I tried to override the existing definitions on `pp.el` and `xref.el` so
> that all Emacs versions in CI used the
> > same code. However the `snapshot` build still fails.
>
> Why can't you ignore the differences in the 'fontified' property?  It
> should be completely uninteresting for your test to pay attention to
> that property.  E.g., run the text through remove-text-properties to
> remove the 'fontified' property, and then compare.
>