Skip to content

Commit

Permalink
Adjust for the removal of MacroSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
DougGregor committed Jan 4, 2023
1 parent 4900a5c commit f00f2ec
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions MacroExamplesPluginTest/MacroExamplesPluginTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ import _SwiftSyntaxMacros
import MacroExamplesPlugin
import XCTest

extension MacroSystem {
static var testSystem: MacroSystem {
var system = MacroSystem()
try! system.add(StringifyMacro.self, name: "stringify")
return system
}
}
var testMacros: [String: Macro.Type] = [
"stringify" : StringifyMacro.self,
]

final class MacroExamplesPluginTests: XCTestCase {
func testStringify() {
Expand All @@ -22,9 +18,7 @@ final class MacroExamplesPluginTests: XCTestCase {
var context = MacroExpansionContext(
moduleName: "MyModule", fileName: "test.swift"
)
let transformedSF = MacroSystem.testSystem.evaluateMacros(
node: sf, in: &context
)
let transformedSF = sf.expand(macros: testMacros, in: &context)
XCTAssertEqual(
transformedSF.description,
#"""
Expand Down

0 comments on commit f00f2ec

Please sign in to comment.