API Behavior Changes
SwiftSyntaxMacrosTestSupportnow supports Swift Testing in addition to XCTest- Description: Macro implementations can now be tested using Swift Testing. Calling
assertMacroExpansion()from a Swift Testing test will record failures as test issues automatically. - Pull Request: #3352
- Migration steps: None required. Existing tests using
SwiftSyntaxMacrosTestSupportwith XCTest continue to work unchanged, but you can convert such tests to Swift Testing if desired. - Notes: If your project has an explicit dependency on the
swift-testingpackage, rather than using a built-in copy of theTestingmodule, you may encounter build or runtime issues. This is a known limitation of using a non-built-in distribution of Swift Testing; the Distributions documentation covers this topic in detail. There are two ways to resolve this: (1) remove the dependency on theswift-testingpackage and switch to using a built-in copy, as the documentation recommends; or (2) importSwiftSyntaxMacrosGenericTestSupportinstead ofSwiftSyntaxMacrosTestSupportand supply your ownfailureHandler:closure that callsIssue.record()explicitly. (The latter works correctly even when using a package dependency.)
- Description: Macro implementations can now be tested using Swift Testing. Calling
Full Changelog: 603.0.1...603.0.2