Skip to content

Conversation

@FlickerSoul
Copy link
Owner

This PR uses swift-macro-testing for easier and manageable macro testing.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-testing library
  • Removed generic type constraints from internal macro visitor classes in favor of any MacroExpansionContext
  • Updated all macro expansion tests to use the new assertMacro DSL with expansion: and diagnostics: 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.

@FlickerSoul FlickerSoul merged commit f0932ab into main Nov 26, 2025
8 checks passed
@FlickerSoul FlickerSoul deleted the feat/macro-testing branch November 26, 2025 16:30
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