New testcase system for exercising typed nodes; Revamp struct tests to use it. #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce some new test helpers, focusing on table-driven tests, and leaning heavily upon json as a shorthand for expressing fixtures.
It also makes a great deal more effort to exercise the different features of nodes (and their paired representation nodes) from all directions at once for each test datum, rather than requiring that all be written out manually, which is how I'd been slogging along previously.
The result is that the struct tests we've renovated have a lovelydiffstat shrinkage: 111 insertions, 299 deletions... but the smaller line count results in more coverage. Yay!
(Okay, the linecount increase for the testcase structure and helper methods is much bigger than the savings in fixture size... but, only so far. I assume this will continue to pay off in the future.)
Relatedly: a bug in struct map representations has been fixed. (It was the sibling of 5f58965, embarrassingly.) Thank goodness we now get proper coverage of this area.
There's a few TODOs left to further expand the some of the tests performed; not sure if I'll append those to this PR before merging or do them in separate small future PRs. Same goes for further expansion of usage of this new system.
There's also some future work to do around the lookup error assertions -- the main sore spot there is that the traversal package doesn't emit very well-typed errors. That's likely best solved in a separate PR since it will mostly involve that package.