Skip to content

[5.10] improve assert macro expansion highlight verification #2373

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

Merged

Conversation

rauhul
Copy link
Member

@rauhul rauhul commented Nov 29, 2023

  • Explanation: assertMacroExpansion can now check multiple highlights exactly match the expected values and single highlights no longer have extraneous trailing trivia.
  • Scope: Client unit tests using assertMacroExpansion
  • Risk: Low(?)
  • Testing: Added new test cases covering macro highlight checking
  • Reviewer: @ahoppen Improve assertMacroExpansion highlight verification #2213

Adds a new initializer to DiagnosticSpec which takes an optional array
of highlights instead of a single optional highlight string. Updates
existing initializer to map the string into an array of one.

Updates assertMacroExpansion to check each highlight in the diagnostic
spec against the actual produced diagnostic individually. Additionally
changes the behavior to drop leading and trailing trivial when
performing the highlight comparison to better match the Swift compiler's
behavior.
@rauhul rauhul requested a review from ahoppen as a code owner November 29, 2023 15:32
@rauhul
Copy link
Member Author

rauhul commented Nov 29, 2023

@swift-ci please test

@rauhul rauhul enabled auto-merge (squash) November 29, 2023 15:32
@rauhul rauhul disabled auto-merge November 29, 2023 15:32
@rauhul rauhul enabled auto-merge (squash) November 29, 2023 15:32
@ahoppen ahoppen requested a review from bnbarham November 29, 2023 19:09
@rauhul rauhul disabled auto-merge December 1, 2023 15:56
@rauhul
Copy link
Member Author

rauhul commented Dec 1, 2023

@swift-ci please test

@rauhul rauhul merged commit b997dc9 into release/5.10 Dec 2, 2023
@rauhul rauhul deleted the 510-Improve-assertMacroExpansion-highlight-verification branch December 2, 2023 02:47
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.

2 participants