crhntr / muxt

Generate HTTP Endpoints from HTML Templates
MIT License
0 stars 0 forks source link

Use static analysis to validate template actions #3

Open crhntr opened 2 months ago

crhntr commented 2 months ago

While gophers can write tests for their templates static analysis of template actions can make catching errors during development easier. We can do this because we are generating the "Execute" calls.

A/C 1

Given the template name does not have a handler call
And a template action accesses an unknown field
When `muxt generate` is called
Then the command should fail with a helpful error message

A/C 2

Given the template name has a handler receiver
And the static receiver method has a non-any return type
And a template action accesses an unknown field or method
When `muxt generate` is called
Then the command should fail with a helpful error message

A/C 3

It should succeed when the template method or field matches the static type values, it should pass.