Skip to content

Commit 537e1a2

Browse files
committed
Rename module from FrameworkAgnostic to Generic
1 parent 7c11953 commit 537e1a2

File tree

7 files changed

+27
-27
lines changed

7 files changed

+27
-27
lines changed

Package.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ let package = Package(
2828
.library(name: "SwiftSyntaxMacroExpansion", targets: ["SwiftSyntaxMacroExpansion"]),
2929
.library(name: "SwiftSyntaxMacrosTestSupport", targets: ["SwiftSyntaxMacrosTestSupport"]),
3030
.library(
31-
name: "SwiftSyntaxMacrosTestSupportFrameworkAgnostic",
32-
targets: ["SwiftSyntaxMacrosTestSupportFrameworkAgnostic"]
31+
name: "SwiftSyntaxMacrosGenericTestSupport",
32+
targets: ["SwiftSyntaxMacrosGenericTestSupport"]
3333
),
3434
],
3535
targets: [
@@ -45,7 +45,7 @@ let package = Package(
4545
.target(
4646
name: "_SwiftSyntaxTestSupport",
4747
dependencies: [
48-
"_SwiftSyntaxTestSupportFrameworkAgnostic",
48+
"_SwiftSyntaxGenericTestSupport",
4949
"SwiftBasicFormat",
5050
"SwiftSyntax",
5151
"SwiftSyntaxBuilder",
@@ -54,7 +54,7 @@ let package = Package(
5454
),
5555

5656
.target(
57-
name: "_SwiftSyntaxTestSupportFrameworkAgnostic",
57+
name: "_SwiftSyntaxGenericTestSupport",
5858
dependencies: []
5959
),
6060

@@ -227,17 +227,17 @@ let package = Package(
227227
"SwiftIDEUtils",
228228
"SwiftParser",
229229
"SwiftSyntaxMacros",
230-
"SwiftSyntaxMacrosTestSupportFrameworkAgnostic",
230+
"SwiftSyntaxMacrosGenericTestSupport",
231231
"SwiftSyntaxMacroExpansion",
232232
]
233233
),
234234

235-
// MARK: SwiftSyntaxMacrosTestSupportFrameworkAgnostic
235+
// MARK: SwiftSyntaxMacrosGenericTestSupport
236236

237237
.target(
238-
name: "SwiftSyntaxMacrosTestSupportFrameworkAgnostic",
238+
name: "SwiftSyntaxMacrosGenericTestSupport",
239239
dependencies: [
240-
"_SwiftSyntaxTestSupportFrameworkAgnostic",
240+
"_SwiftSyntaxGenericTestSupport",
241241
"SwiftDiagnostics",
242242
"SwiftIDEUtils",
243243
"SwiftParser",

Release Notes/600.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
- Description: `Range<AbsolutePosition>` gained a few convenience functions inspired from `ByteSourceRange`: `init(position:length:)`, `length`, `overlapsOrTouches`
9696
- Pull request: https://github.com/apple/swift-syntax/pull/2587
9797

98-
- `SwiftSyntaxMacrosTestSupportFrameworkAgnostic`
98+
- `SwiftSyntaxMacrosGenericTestSupport`
9999
- Description: A version of the `SwiftSyntaxMacrosTestSupport` module that doesn't depend on `Foundation` or `XCTest` and can thus be used to write macro tests using `swift-testing`. Since swift-syntax can't depend on swift-testing (which would incur a circular dependency since swift-testing depends on swift-syntax), users need to manually specify a failure handler like the following, that fails the swift-testing test: `Issue.record("\($0.message)", fileID: $0.location.fileID, filePath: $0.location.filePath, line: $0.location.line, column: $0.location.column)`
100100
- Pull request: https://github.com/apple/swift-syntax/pull/2647
101101

Sources/SwiftSyntaxMacrosTestSupportFrameworkAgnostic/Assertions.swift renamed to Sources/SwiftSyntaxMacrosGenericTestSupport/Assertions.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import SwiftParserDiagnostics
1919
public import SwiftSyntax
2020
public import SwiftSyntaxMacroExpansion
2121
private import SwiftSyntaxMacros
22-
private import _SwiftSyntaxTestSupportFrameworkAgnostic
22+
private import _SwiftSyntaxGenericTestSupport
2323
#else
2424
import SwiftBasicFormat
2525
import SwiftDiagnostics
@@ -29,7 +29,7 @@ import SwiftParserDiagnostics
2929
import SwiftSyntax
3030
import SwiftSyntaxMacroExpansion
3131
import SwiftSyntaxMacros
32-
import _SwiftSyntaxTestSupportFrameworkAgnostic
32+
import _SwiftSyntaxGenericTestSupport
3333
#endif
3434

3535
/// Defines the location at which the a test failure should be anchored. This is typically the location where the
@@ -59,7 +59,7 @@ public struct TestFailureLocation {
5959
self.unsignedColumn = column
6060
}
6161

62-
fileprivate init(underlying: _SwiftSyntaxTestSupportFrameworkAgnostic.TestFailureLocation) {
62+
fileprivate init(underlying: _SwiftSyntaxGenericTestSupport.TestFailureLocation) {
6363
self.init(
6464
fileID: underlying.fileID,
6565
filePath: underlying.filePath,
@@ -68,10 +68,10 @@ public struct TestFailureLocation {
6868
)
6969
}
7070

71-
/// This type is intentionally different to `_SwiftSyntaxTestSupportFrameworkAgnostic.TestFailureLocation` so we can
72-
/// import `_SwiftSyntaxTestSupportFrameworkAgnostic` privately and don't expose its internal types.
73-
fileprivate var underlying: _SwiftSyntaxTestSupportFrameworkAgnostic.TestFailureLocation {
74-
_SwiftSyntaxTestSupportFrameworkAgnostic.TestFailureLocation(
71+
/// This type is intentionally different to `_SwiftSyntaxGenericTestSupport.TestFailureLocation` so we can
72+
/// import `_SwiftSyntaxGenericTestSupport` privately and don't expose its internal types.
73+
fileprivate var underlying: _SwiftSyntaxGenericTestSupport.TestFailureLocation {
74+
_SwiftSyntaxGenericTestSupport.TestFailureLocation(
7575
fileID: self.staticFileID,
7676
filePath: self.staticFilePath,
7777
line: self.unsignedLine,
@@ -91,7 +91,7 @@ public struct TestFailureSpec {
9191
self.location = location
9292
}
9393

94-
fileprivate init(underlying: _SwiftSyntaxTestSupportFrameworkAgnostic.TestFailureSpec) {
94+
fileprivate init(underlying: _SwiftSyntaxGenericTestSupport.TestFailureSpec) {
9595
self.init(
9696
message: underlying.message,
9797
location: TestFailureLocation(underlying: underlying.location)

Sources/SwiftSyntaxMacrosTestSupport/Assertions.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
public import SwiftSyntax
1515
public import SwiftSyntaxMacroExpansion
1616
public import SwiftSyntaxMacros
17-
@_spi(XCTestFailureLocation) public import SwiftSyntaxMacrosTestSupportFrameworkAgnostic
17+
@_spi(XCTestFailureLocation) public import SwiftSyntaxMacrosGenericTestSupport
1818
private import XCTest
1919
#else
2020
import SwiftSyntax
2121
import SwiftSyntaxMacroExpansion
2222
import SwiftSyntaxMacros
23-
@_spi(XCTestFailureLocation) import SwiftSyntaxMacrosTestSupportFrameworkAgnostic
23+
@_spi(XCTestFailureLocation) import SwiftSyntaxMacrosGenericTestSupport
2424
import XCTest
2525
#endif
2626

27-
// Re-export the spec types from `SwiftSyntaxMacrosTestSupportFrameworkAgnostic`.
28-
public typealias NoteSpec = SwiftSyntaxMacrosTestSupportFrameworkAgnostic.NoteSpec
29-
public typealias FixItSpec = SwiftSyntaxMacrosTestSupportFrameworkAgnostic.FixItSpec
30-
public typealias DiagnosticSpec = SwiftSyntaxMacrosTestSupportFrameworkAgnostic.DiagnosticSpec
27+
// Re-export the spec types from `SwiftSyntaxMacrosGenericTestSupport`.
28+
public typealias NoteSpec = SwiftSyntaxMacrosGenericTestSupport.NoteSpec
29+
public typealias FixItSpec = SwiftSyntaxMacrosGenericTestSupport.FixItSpec
30+
public typealias DiagnosticSpec = SwiftSyntaxMacrosGenericTestSupport.DiagnosticSpec
3131

3232
/// Assert that expanding the given macros in the original source produces
3333
/// the given expanded source code.
@@ -107,7 +107,7 @@ public func assertMacroExpansion(
107107
file: StaticString = #filePath,
108108
line: UInt = #line
109109
) {
110-
SwiftSyntaxMacrosTestSupportFrameworkAgnostic.assertMacroExpansion(
110+
SwiftSyntaxMacrosGenericTestSupport.assertMacroExpansion(
111111
originalSource,
112112
expandedSource: expectedExpandedSource,
113113
diagnostics: diagnostics,

Sources/_SwiftSyntaxTestSupport/AssertEqualWithDiff.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
#if swift(>=6)
1414
public import Foundation
1515
private import XCTest
16-
private import _SwiftSyntaxTestSupportFrameworkAgnostic
16+
private import _SwiftSyntaxGenericTestSupport
1717
#else
1818
import Foundation
1919
import XCTest
20-
import _SwiftSyntaxTestSupportFrameworkAgnostic
20+
import _SwiftSyntaxGenericTestSupport
2121
#endif
2222

2323
/// Asserts that the two strings are equal, providing Unix `diff`-style output if they are not.
@@ -45,7 +45,7 @@ public func assertStringsEqualWithDiff(
4545
line: line,
4646
column: 0 // Not used in the failure handler
4747
)
48-
return _SwiftSyntaxTestSupportFrameworkAgnostic.assertStringsEqualWithDiff(
48+
return _SwiftSyntaxGenericTestSupport.assertStringsEqualWithDiff(
4949
actual,
5050
expected,
5151
message,

0 commit comments

Comments
 (0)