You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add end-to-end tests for Mustachio AOT compiler (dart-lang#2664)
Add end-to-end tests for Mustachio AOT compiler
These tests, in aot_compiler_render_test.dart, are a little irregular. The goal
is to write short test cases in which we specify the text of a Mustache
template, and the expected rendered text, visually near each other, which is a
challenge, as there are several steps to get from Mustache template text to
rendered output, including running the builders, and executing freshly
generated Dart code.
The solution here is a test system which takes a Mustache template text, runs
the mustachio AOT compiler to generate a Dart script which renders a context
object into that template, then executes the generated Dart script, and
asserts on the output.
Writing these tests revealed a few bugs that are fixed concurrently:
* imports in the generated script should be accurate; this requires using
code_builder, which requires a sizeable change to the AOT compiler code.
code_builder allows you to "reference" symbols like types or top-level
functions and the URL where they may be found.
* handle partial template paths with dots and slashes.
Additionally, fix some nits in runtime_renderer_builder_test.dart and
runtime_renderer_render_test.dart.
0 commit comments