Skip to content

Commit fc60a28

Browse files
committed
chore: remove swift-macro-testing dependency
1 parent ee12052 commit fc60a28

File tree

4 files changed

+23
-34
lines changed

4 files changed

+23
-34
lines changed

Package.resolved

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,13 @@
99
"version" : "5.1.0"
1010
}
1111
},
12-
{
13-
"identity" : "swift-macro-testing",
14-
"kind" : "remoteSourceControl",
15-
"location" : "https://github.com/pointfreeco/swift-macro-testing",
16-
"state" : {
17-
"revision" : "20c1a8f3b624fb5d1503eadcaa84743050c350f4",
18-
"version" : "0.5.2"
19-
}
20-
},
21-
{
22-
"identity" : "swift-snapshot-testing",
23-
"kind" : "remoteSourceControl",
24-
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
25-
"state" : {
26-
"revision" : "6d932a79e7173b275b96c600c86c603cf84f153c",
27-
"version" : "1.17.4"
28-
}
29-
},
3012
{
3113
"identity" : "swift-syntax",
3214
"kind" : "remoteSourceControl",
3315
"location" : "https://github.com/apple/swift-syntax.git",
3416
"state" : {
35-
"revision" : "2bc86522d115234d1f588efe2bcb4ce4be8f8b82",
36-
"version" : "510.0.3"
17+
"revision" : "cb53fa1bd3219b0b23ded7dfdd3b2baff266fd25",
18+
"version" : "600.0.0"
3719
}
3820
}
3921
],

Package.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ let package = Package(
2121
dependencies: [
2222
// Depend on the Swift 5.9 release of SwiftSyntax
2323
.package(url: "https://github.com/apple/swift-syntax.git", from: "600.0.0"),
24-
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.5.2"),
2524
.package(url: "https://github.com/vadymmarkov/Fakery", from: "5.1.0")
2625
],
2726
targets: [
@@ -54,7 +53,6 @@ let package = Package(
5453
dependencies: [
5554
"LoremSwiftifyMacros",
5655
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
57-
.product(name: "MacroTesting", package: "swift-macro-testing"),
5856
]
5957
),
6058
]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import MacroTesting
21
import XCTest
32

4-
final class LoremSwiftifyTests: MacroTestCase {
3+
final class LoremSwiftifyTests: XCTestCase {
54

65
}

Tests/LoremSwiftsumizeTests/TestUtils/MacroTestCase.swift

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,31 @@
66
import Foundation
77
import SwiftSyntaxMacros
88
import SwiftSyntaxMacrosTestSupport
9-
import MacroTesting
109
import XCTest
1110

1211
#if canImport(LoremSwiftifyMacros)
1312
import LoremSwiftifyMacros
13+
14+
let testMacros: [String: Macro.Type] = [
15+
"LoremSwiftifyMacros": LoremSwiftifyMacro.self
16+
]
1417
#endif
1518

16-
class MacroTestCase: XCTestCase {
17-
override func invokeTest() {
18-
#if canImport(LoremSwiftifyMacros)
19-
withMacroTesting(record: false, macros: ["LoremSwiftifyMacros": LoremSwiftifyMacro.self]) {
20-
super.invokeTest()
21-
}
22-
#else
23-
fatalError("Macro tests can only be run on the host platform!")
24-
#endif
19+
extension XCTestCase {
20+
func assertMacro(
21+
_ originalSource: String,
22+
expandedSource expectedExpandedSource: String,
23+
diagnostics: [DiagnosticSpec] = [],
24+
applyFixIts: [String]? = nil,
25+
fixedSource expectedFixedSource: String? = nil
26+
) {
27+
assertMacroExpansion(
28+
originalSource,
29+
expandedSource: expectedExpandedSource,
30+
diagnostics: diagnostics,
31+
macros: testMacros,
32+
applyFixIts: applyFixIts,
33+
fixedSource: expectedFixedSource
34+
)
2535
}
2636
}

0 commit comments

Comments
 (0)