I started working on this because there was a bug when minifying a + +a. It was becoming a++a which is invalid.
But I weren't very excited about how the minifying tests were done, so if you don't I added more than just fixing this bug:
I added the ability to compare ast object. (This is the big part of the diff. I didn't want to do something generic, because in python explicit is better than generic. So I went over each ast types and added equality and __repr__)
I didn't like how classes were monkey-patched. I felt that Metaclasses would be a better way to do that. (And this is why there were intended) so I refactored the test case creation into a big metaclasses generating the tests.
I created tests which asserted that parse(source) == parse(minified(source))
Let me know what you think, or if you want me to change anything.
Hey @rspivak ,
I started working on this because there was a bug when minifying
a + +a
. It was becominga++a
which is invalid.But I weren't very excited about how the minifying tests were done, so if you don't I added more than just fixing this bug:
__repr__
)parse(source) == parse(minified(source))
Let me know what you think, or if you want me to change anything.
Thanks!