Skip to content

Commit d55ddb9

Browse files
committed
-
1 parent 1da8325 commit d55ddb9

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

Sources/PrincipleMacros/Parameters/ParameterExtractor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public struct ParameterExtractor {
6464
return rawString
6565
}
6666

67-
public func preferredGlobalActorIsolation(
67+
public func globalActorIsolation(
6868
withLabel label: TokenSyntax?
6969
) throws -> GlobalActorIsolation? {
7070
guard let expression = expression(withLabel: label) else {

Tests/PrincipleMacrosTests/Parameters/ParameterExtractorTests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,16 @@ extension ParameterExtractorTests {
7878
extension ParameterExtractorTests {
7979

8080
@Test
81-
func testMissingPreferredGlobalActorExtraction() throws {
81+
func testMissingGlobalActorExtraction() throws {
8282
let extractor = try makeExtractor(from: "#MyMacro()")
83-
let extracted = try extractor.preferredGlobalActorIsolation(withLabel: "isolation")
83+
let extracted = try extractor.globalActorIsolation(withLabel: "isolation")
8484
#expect(extracted == nil)
8585
}
8686

8787
@Test
88-
func testNonisolatedPreferredGlobalActorExtraction() throws {
88+
func testExplicitNilGlobalActorExtraction() throws {
8989
let extractor = try makeExtractor(from: "#MyMacro(isolation: nil)")
90-
let extracted = try extractor.preferredGlobalActorIsolation(withLabel: "isolation")
90+
let extracted = try extractor.globalActorIsolation(withLabel: "isolation")
9191
#expect(extracted == .nonisolated)
9292
}
9393

@@ -97,17 +97,17 @@ extension ParameterExtractorTests {
9797
"SomeType.SomeActor"
9898
]
9999
)
100-
func testIsolatedPreferredGlobalActorExtraction(isolation: String) throws {
100+
func testGlobalActorExtraction(isolation: String) throws {
101101
let extractor = try makeExtractor(from: "#MyMacro(isolation: \(raw: isolation).self)")
102-
let extracted = try extractor.preferredGlobalActorIsolation(withLabel: "isolation")
102+
let extracted = try extractor.globalActorIsolation(withLabel: "isolation")
103103
#expect(extracted?.trimmedType?.description == isolation)
104104
}
105105

106106
@Test
107-
func testUnexpectedSyntaxWhenPerformingPreferredGlobalActorExtraction() throws {
107+
func testUnexpectedSyntaxWhenPerformingGlobalActorExtraction() throws {
108108
let extractor = try makeExtractor(from: #"#MyMacro(isolation: MainActor.Type)"#)
109109
#expect(throws: ParameterExtractionError.unexpectedSyntaxType) {
110-
try extractor.preferredGlobalActorIsolation(withLabel: "isolation")
110+
try extractor.globalActorIsolation(withLabel: "isolation")
111111
}
112112
}
113113
}

0 commit comments

Comments
 (0)