Generally you could compare the generated output against a defined result file.

But often it is better to test the generated code on a runtime/ functional base (e.g. using unit tests) and not on source code base - since it imho does not play a role if the generated code stays the same even for the least blank .

If you are interested in testing Xtend / Xpand on a more fine granular level then take a look at fit4oaw: