carbon-lang
carbon-lang copied to clipboard
Consider switching away from designated initializer based testing
Both the lexer and parser libraries use a similar technique for testing. They define structs suitable for use with designated initializers, and then hand them to matchers.
It might be worthwhile to switch to building matchers directly instead, as this would likely produce nicer error messages. One challenge will be test readability, but there may be ways to address this.
For tokens, this seems fairly straight forward, but for the parser this is more interesting.
Filing this issue just to track the overall discussion around the best design here, and implementing whatever the result looks like.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please comment or remove the inactive label. The long term label can also be added for issues which are expected to take time.
This issue is labeled inactive because the last activity was over 90 days ago.
I'm closing this, I think we're mostly using the file test infrastructure now. Please reopen if you're still thinking about something different here.