In https://github.com/djc/askama/pull/1037, I tried to add tests for generated content but it was quite ugly so I finally didn't put it into the PR until I find a better implementation.
I still think that we should have AST tests, in particular to ensure that code generation improvements don't have "hidden" regressions and that changes don't go unnoticed.
I guess we could do something like syn::parse(generated_code) == syn::parse("expected::code()"). syn's PartialEq ignores spans, so I think this should work.
In https://github.com/djc/askama/pull/1037, I tried to add tests for generated content but it was quite ugly so I finally didn't put it into the PR until I find a better implementation.
I still think that we should have AST tests, in particular to ensure that code generation improvements don't have "hidden" regressions and that changes don't go unnoticed.