Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor tests. #595

Merged
merged 1 commit into from
Aug 20, 2023
Merged

Refactor tests. #595

merged 1 commit into from
Aug 20, 2023

Conversation

allevato
Copy link
Member

This PR significantly improves the testing infrastructure by adopting the emoji markers used by SwiftSyntax's parser tests. This makes it easier to read and write tests, because the markers indicate in the string where the finding should be emitted and we don't have to compute line/column numbers manually.

Additional testing improvements include:

  • Tests are no longer stateful w.r.t. collecting findings, so a single test can safely call its assert* helpers multiple times.
  • Tests verify the actual text of the findings, not just their symbolic values/constructors. Previously, we weren't actually verifying that the messages were what we wanted them to be, and this has revealed a couple minor issues.
  • I've dropped the XCT* prefix on our own custom assertions, because we shouldn't be using their namespace.

I've added a handful of FIXME comments for things I caught during the migration that need to be addressed.

This PR significantly improves the testing infrastructure by adopting
the emoji markers used by SwiftSyntax's parser tests. This makes it
easier to read and write tests, because the markers indicate in the
string where the finding should be emitted and we don't have to compute
line/column numbers manually.

Additional testing improvements include:

- Tests are no longer stateful w.r.t. collecting findings, so a single
  test can safely call its `assert*` helpers multiple times.
- Tests verify the actual text of the findings, not just their symbolic
  values/constructors. Previously, we weren't actually verifying that
  the *messages* were what we wanted them to be, and this has revealed
  a couple minor issues.
- I've dropped the `XCT*` prefix on our own custom assertions, because
  we shouldn't be using their namespace.

I've added a handful of FIXME comments for things I caught during the
migration that need to be addressed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant