ReTeX / ReX

ReX - typesetting mathematics
122 stars 8 forks source link

Need a testing framework #9

Open cbreeden opened 7 years ago

cbreeden commented 7 years ago

There is some prior work done here for related projects:

Selenium might be best for getting an accurate representation for our rendered SVG. I proposed that we places Rules in the document to be used to assist in measuring distances. Another option would be to do something similar to what KaTeX does and compare the output with LaTeX.

ghost commented 7 years ago

First of all, I don't think this can be fully automated. More of a machine assisted diffing. The advantage of ReX is the backend independent rendering, so one could write a TestRenderer which produces a type TestSet = Set<(Cursor, Scale, Glyph)>;. This output would be compared to a previous version and pass if the sets are equal up to some ɛ > 0.

How the different Renderer implementations compare their output is a different story.

cbreeden commented 7 years ago

Yeah this is far more realistic now that we have the absolute position of each glyph. Rex could even construct a "diff" by painting the glyphs a different color: one red, the other blue. This could make visualizing the changes quite nice. I've been using Batik lately to rasterize the glyphs (it's what rasterizes the images on the front page).