Drop swift-macro-testing to unblock SwiftSyntax updates#198
Merged
Conversation
Replace MacroTesting's `assertMacro` with SwiftSyntaxMacrosTestSupport's `assertMacroExpansion` across all macro tests. This removes the swift-macro-testing (and transitive swift-snapshot-testing) dependency, which was constraining swift-syntax version resolution despite being test-only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- AttributedTypeSyntax test: wrap @autoclosure in a function parameter context, as standalone @autoclosure is no longer parsed as AttributedTypeSyntax in 603 - Unexpected nodes test: use :::brokenSyntax at class body level instead of broken code inside function/variable bodies, since 603's improved error recovery nests those unexpected nodes inside the function/variable declarations (which FileVisitor skips) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
f60be3a to
2215552
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #198 +/- ##
==========================================
- Coverage 99.90% 99.87% -0.04%
==========================================
Files 32 32
Lines 3274 3274
==========================================
- Hits 3271 3270 -1
- Misses 3 4 +1
🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
assertMacroExpansion from SwiftSyntaxMacrosTestSupport uses XCTFail internally, which is silently ignored under Swift Testing's @test. This meant all 113 macro expansion assertions were no-ops. Fix by: - Adding a wrapper that uses SwiftSyntaxMacrosGenericTestSupport's assertMacroExpansion with a custom failureHandler that calls Issue.record() from Swift Testing - Fixing expandedSource in all diagnostic tests to match the actual expansion of the original source (macro attrs stripped, no generated members) rather than the expansion of the fixed source Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Covers the else branch in generateForwardedProperties (tuple ForwardedProperties typealias) which was previously only exercised via MacroTesting's fix-it-then-re-expand flow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Motivation
swift-macro-testing is a test-only dependency, but because it is declared as a top-level package dependency, its swift-syntax version constraints lock the entire package to an older resolved version. Removing it allows us to update SwiftSyntax freely without being blocked by a third-party test utility.