File tree 4 files changed +23
-34
lines changed
Tests/LoremSwiftsumizeTests 4 files changed +23
-34
lines changed Original file line number Diff line number Diff line change 9
9
"version" : " 5.1.0"
10
10
}
11
11
},
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
- },
30
12
{
31
13
"identity" : " swift-syntax" ,
32
14
"kind" : " remoteSourceControl" ,
33
15
"location" : " https://github.com/apple/swift-syntax.git" ,
34
16
"state" : {
35
- "revision" : " 2bc86522d115234d1f588efe2bcb4ce4be8f8b82 " ,
36
- "version" : " 510 .0.3 "
17
+ "revision" : " cb53fa1bd3219b0b23ded7dfdd3b2baff266fd25 " ,
18
+ "version" : " 600 .0.0 "
37
19
}
38
20
}
39
21
],
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ let package = Package(
21
21
dependencies: [
22
22
// Depend on the Swift 5.9 release of SwiftSyntax
23
23
. 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 " ) ,
25
24
. package ( url: " https://github.com/vadymmarkov/Fakery " , from: " 5.1.0 " )
26
25
] ,
27
26
targets: [
@@ -54,7 +53,6 @@ let package = Package(
54
53
dependencies: [
55
54
" LoremSwiftifyMacros " ,
56
55
. product( name: " SwiftSyntaxMacrosTestSupport " , package : " swift-syntax " ) ,
57
- . product( name: " MacroTesting " , package : " swift-macro-testing " ) ,
58
56
]
59
57
) ,
60
58
]
Original file line number Diff line number Diff line change 1
- import MacroTesting
2
1
import XCTest
3
2
4
- final class LoremSwiftifyTests : MacroTestCase {
3
+ final class LoremSwiftifyTests : XCTestCase {
5
4
6
5
}
Original file line number Diff line number Diff line change 6
6
import Foundation
7
7
import SwiftSyntaxMacros
8
8
import SwiftSyntaxMacrosTestSupport
9
- import MacroTesting
10
9
import XCTest
11
10
12
11
#if canImport(LoremSwiftifyMacros)
13
12
import LoremSwiftifyMacros
13
+
14
+ let testMacros : [ String : Macro . Type ] = [
15
+ " LoremSwiftifyMacros " : LoremSwiftifyMacro . self
16
+ ]
14
17
#endif
15
18
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
+ )
25
35
}
26
36
}
You can’t perform that action at this time.
0 commit comments