diff --git a/Package.resolved b/Package.resolved index a18b6f7..4e5d996 100644 --- a/Package.resolved +++ b/Package.resolved @@ -9,31 +9,13 @@ "version" : "5.1.0" } }, - { - "identity" : "swift-macro-testing", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swift-macro-testing", - "state" : { - "revision" : "20c1a8f3b624fb5d1503eadcaa84743050c350f4", - "version" : "0.5.2" - } - }, - { - "identity" : "swift-snapshot-testing", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swift-snapshot-testing", - "state" : { - "revision" : "6d932a79e7173b275b96c600c86c603cf84f153c", - "version" : "1.17.4" - } - }, { "identity" : "swift-syntax", "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-syntax.git", "state" : { - "revision" : "2bc86522d115234d1f588efe2bcb4ce4be8f8b82", - "version" : "510.0.3" + "revision" : "cb53fa1bd3219b0b23ded7dfdd3b2baff266fd25", + "version" : "600.0.0" } } ], diff --git a/Package.swift b/Package.swift index 1d6cc59..e735bd9 100644 --- a/Package.swift +++ b/Package.swift @@ -21,7 +21,6 @@ let package = Package( dependencies: [ // Depend on the Swift 5.9 release of SwiftSyntax .package(url: "https://github.com/apple/swift-syntax.git", from: "600.0.0"), - .package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.5.2"), .package(url: "https://github.com/vadymmarkov/Fakery", from: "5.1.0") ], targets: [ @@ -54,7 +53,6 @@ let package = Package( dependencies: [ "LoremSwiftifyMacros", .product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"), - .product(name: "MacroTesting", package: "swift-macro-testing"), ] ), ] diff --git a/Tests/LoremSwiftsumizeTests/LoremSwiftsumizeTests.swift b/Tests/LoremSwiftsumizeTests/LoremSwiftsumizeTests.swift index a016cec..0447590 100644 --- a/Tests/LoremSwiftsumizeTests/LoremSwiftsumizeTests.swift +++ b/Tests/LoremSwiftsumizeTests/LoremSwiftsumizeTests.swift @@ -1,6 +1,5 @@ -import MacroTesting import XCTest -final class LoremSwiftifyTests: MacroTestCase { +final class LoremSwiftifyTests: XCTestCase { } diff --git a/Tests/LoremSwiftsumizeTests/TestUtils/MacroTestCase.swift b/Tests/LoremSwiftsumizeTests/TestUtils/MacroTestCase.swift index bfdb888..827a17d 100644 --- a/Tests/LoremSwiftsumizeTests/TestUtils/MacroTestCase.swift +++ b/Tests/LoremSwiftsumizeTests/TestUtils/MacroTestCase.swift @@ -6,21 +6,31 @@ import Foundation import SwiftSyntaxMacros import SwiftSyntaxMacrosTestSupport -import MacroTesting import XCTest #if canImport(LoremSwiftifyMacros) import LoremSwiftifyMacros + +let testMacros: [String: Macro.Type] = [ + "LoremSwiftifyMacros": LoremSwiftifyMacro.self +] #endif -class MacroTestCase: XCTestCase { - override func invokeTest() { - #if canImport(LoremSwiftifyMacros) - withMacroTesting(record: false, macros: ["LoremSwiftifyMacros": LoremSwiftifyMacro.self]) { - super.invokeTest() - } - #else - fatalError("Macro tests can only be run on the host platform!") - #endif +extension XCTestCase { + func assertMacro( + _ originalSource: String, + expandedSource expectedExpandedSource: String, + diagnostics: [DiagnosticSpec] = [], + applyFixIts: [String]? = nil, + fixedSource expectedFixedSource: String? = nil + ) { + assertMacroExpansion( + originalSource, + expandedSource: expectedExpandedSource, + diagnostics: diagnostics, + macros: testMacros, + applyFixIts: applyFixIts, + fixedSource: expectedFixedSource + ) } }