thema: Add compat checking cases, improve errors #153
Merged
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.
This PR separates out a clear pattern within the
invalidlineages
testdata corpus for checking backwards compatibility invariants on schemas. It accomplishes this through negation - defining a series of schemas that violate a particular rule, and expecting thatBindLineage
throws an error when encountering such a case. This approach is sufficient to establish the rule, because the law of the excluded middle applies in this case - every schema relation is either backwards compatible, xor not, and every syntactic version numbering either adheres to that, xor not.As indicated by several of these cases being in the
ToDo
list forTestInvalidLineages
, Thema's checkers do not yet catch all of these cases.The error output is also somewhat improved here, though we are not yet doing a reliably good job of providing line-level feedback in the way that we really ought to according to the principles outlined in #44.
Finally, this also fixes a huge 🤦🏻 - when doing backwards compatibility checking, the parameters being passed to
compat.ThemaCompatible()
were reversed, resulting in checking if e.g. 0.0 was backwards compatible with 0.1, rather than vice-versa.cc @joanlopez @mildwonkey