Skip to content

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.

3 participants