hamlphp / HamlPHP

Yet another Haml to HTML converter written in PHP.
http://hamlphp.github.com/HamlPHP
MIT License
84 stars 15 forks source link

Better way to test #20

Closed svallory closed 12 years ago

svallory commented 12 years ago

We need a better way to test the parser. The issue is everytime a single whitespace changes the test fail. Although the result is still valid html and equivalent to the expected result, since we are doing a string comparison, they don't match anymore.

So, the tests are currently failing, and I'm gonna keep them that way until either we find a better way to test, or all the planed features for the Avant release are done and we really need the tests to be ok.

The idea of posting this issue here is to try to gather ideas of how to do the tests. I'm currently thinking about parsing the generated html and comparing the nodes.

Do you have a better idea? Please share it!

svallory commented 12 years ago

We are using XmlDiff to compare the expected and the actual results. It's not space sensitive as it compares nodes, attributes and attribute values. Tests are all passing now, but a lot of tests still need to be rewritten though.