[red-knot] consolidate diagnostic and inference tests #13248
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.
Pull the tests from
types.rs
intoinfer.rs
.All of these are integration tests with the same basic form: create a code sample, run type inference or check on it, and make some assertions about types and/or diagnostics. These are the sort of tests we will want to move into a test framework with a low-boilerplate custom textual format. In the meantime, having them together (and more importantly, their helper utilities together) means that it's easy to keep tests for related language features together (iterable tests with other iterable tests, callable tests with other callable tests), without an artificial split based on tests which test diagnostics vs tests which test inference. And it allows a single test to more easily test both diagnostics and inference. (Ultimately in the test framework, they will likely all test diagnostics, just in some cases the diagnostics will come from
reveal_type()
.)