Guenter Milde wrote:

> On 2015-10-20, Georg Baum wrote:
> 
>> Just to avoid future errors: I assume that you did check before that a
>> simple update of the format number is OK, and that no tex2lyx source code
>> changes are needed? How to do such checks in described in section 2.3 of
>> Development.lyx, item 5.
> 
> Actually, no. (My aim was just to ensure the tests work again, not to make
> a full review of the fileformat change.)

Well, if the tests pass, then this means that the parts of tex2lyx that are 
tested by them work correctly. However, if the references are updated 
without a check whether the file format change needs an adjustment in 
tex2lyx, then the tests could potentially lie. Fortunately we do not have 
many examples where this happened, because the tests are now mostly updated 
correctly. However, one case where the test update was not done immediately 
is http://www.lyx.org/trac/changeset/c246076e/lyxgit/. If for this change 
only the file format number of the test references would have been updated, 
then wrong output would have been hidden. As you can see in 
http://www.lyx.org/trac/changeset/9c33bddf/lyxgit/, the update did also 
require a change in tex2lyx itself.

For this reason it is better to not update the tests, if one does not want 
to do the necessary checks for correctness as well.

> From the posts in this thread, I realized that the version number was
> changed without updating the reference files.
> 
> I run the tests and found that only the *.lyx.lyx reference files
> produced errors, and the only difference was the version number.
> 
> Then I changed just the last digit of the number via a grep-replace in my
> text editor. This is the method to fix false positives I am used to from
> my work on test driven development of "Docutils". It ensures that no
> change can go unnoticed.
> I did not touch any files with LyX but also not use "make updatetests".

Unfortunately even this manual procedure does not ensure that the file 
format update does not hide a bug. In the example I gave above, it would 
have lead to passing tests, although the output would have been wrong.

> @Uwe: could you please check, if the improvements that led to the file
>       format change require changes in tex2lyx and either add a note to
>       "src/tex2lyx/TODO.txt" if yes?

In order to stop unneeded work I did the check now. Fortunately it is very 
simple to do in this case: Section 2.3 of Development.lyx says that simply 
updating the file format number is safe if the lyx2lyx conversion from the 
previous format to the new one is empty. Since this is the case for the 
conversion from 497 to 498, all is fine now.
 
>       In any case, it would be nice to have a minimal *.tex file using
>       the new features so that it may be put in the test suite (or a
>       related test case amended).

Definitely.


Georg

Reply via email to