Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis committed Dec 12, 2023
1 parent 03fe3ff commit c9cdc8d
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,22 @@ final class DependencyClientMacroTests: BaseTestCase {
var endpoint: @Sendable () -> Int = { <#Int#> }
}
"""
} expansion: {
"""
struct Client: Sendable {
@DependencyEndpoint
var endpoint: @Sendable () -> Int = { <#Int#> }
init(
endpoint: @Sendable @escaping () -> Int
) {
self.endpoint = endpoint
}
init() {
}
}
"""
}
}

Expand Down Expand Up @@ -788,6 +804,26 @@ final class DependencyClientMacroTests: BaseTestCase {
public var bar: () -> String = { { fatalError("Goodbye") }() }
}
"""
} expansion: {
"""
struct Blah {
@DependencyEndpoint
public var foo: () -> String = { { fatalError() }() }
@DependencyEndpoint
public var bar: () -> String = { { fatalError("Goodbye") }() }
public init(
foo: @escaping () -> String,
bar: @escaping () -> String
) {
self.foo = foo
self.bar = bar
}
public init() {
}
}
"""
}
}
}

0 comments on commit c9cdc8d

Please sign in to comment.