Skip to content

Generator test-case expected-update #38

@vaind

Description

@vaind

The code generator is tested using "golden/expected" files - verifying the generated code matches the expected code exactly. While this is a great way to make sure the code doesn't change unexpectedly and there are no regressions, it poses a challenge when actually changing the generator code (as a developer).

To achieve a good developer experience, the test-cases expected code should be updatable by calling a single command. For example, in Go, tests are normally called as go test tests/generator while there's an option to update the .expected files calling go test tests/generator -update.

After the files are updated, it's up to the developer to verify the changes are correct (by manually reviewing them), before committing the code to git.

Metadata

Metadata

Assignees

Labels

help wantedLooking for contributors (ideas, comments, code, etc)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions