thymeleaf-testing icon indicating copy to clipboard operation
thymeleaf-testing copied to clipboard

Use html-pretty-printer for comparing generated result with expected result.

Open opensource21 opened this issue 12 years ago • 0 comments

If you write test you must create an expected result exactly (character by character) as it will be generated. Mostly I only want to know if the html-structure is good. It's much more convenient to write the expected structure with newlines and indention, than writing everything into one single line with blanks in it. So I would prefer to have the possibility to pretty-print the result and the expected result. This can be done with XMLPretty-Printing or more less accurate with JTidy. Another approach would be to compare the DOM-Tree directly. Third solution: Take the expected result and remove all unused Whitespaces.

opensource21 avatar Oct 02 '13 05:10 opensource21