Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the macro testing infrastructure by migrating from a custom assertMacroExpansion wrapper to the swift-macro-testing library from Point-Free. This provides a cleaner, more maintainable testing API with better diagnostic visualization.
Key Changes:
- Replaced custom macro test infrastructure with
swift-macro-testinglibrary - Removed generic type constraints from internal macro visitor classes in favor of
any MacroExpansionContext - Updated all macro expansion tests to use the new
assertMacroDSL withexpansion:anddiagnostics:blocks
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Package.swift | Added swift-macro-testing dependency (v0.6.4) to test target |
| Package.resolved | Added transitive dependencies for swift-macro-testing (swift-custom-dump, swift-snapshot-testing, xctest-dynamic-overlay) |
| Tests/BinaryParseKitMacroTests/Misc.swift | Removed custom assertMacroExpansion wrapper and related helpers; changed testMacros visibility to package-level |
| Tests/BinaryParseKitMacroTests/BinaryParseKitStructTests.swift | Migrated all struct macro tests to use assertMacro with visual diagnostic markers |
| Tests/BinaryParseKitMacroTests/BinaryParseKitEnumTests.swift | Migrated all enum macro tests to use assertMacro with improved readability |
| Sources/BinaryParseKitMacros/Macros/Supports/ParseMacroInfo.swift | Changed ParseMacroArgVisitor from generic class to using any MacroExpansionContext |
| Sources/BinaryParseKitMacros/Macros/Supports/MacroAttributeCollector.swift | Changed MacroAttributeCollector from generic class to using any MacroExpansionContext |
| Sources/BinaryParseKitMacros/Macros/ParseStruct/ParseStructField.swift | Changed ParseStructField from generic class to using any MacroExpansionContext |
| Sources/BinaryParseKitMacros/Macros/ParseEnum/ParseEnumCase.swift | Changed ParseEnumCase from generic class to using any MacroExpansionContext |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 uses swift-macro-testing for easier and manageable macro testing.