#if canImport(Testing) import Dependencies import DependenciesTestSupport import SourceControlClient import Testing public struct SourceControlClientBackend: Sendable { public var makeClient: @Sendable () -> SourceControlClient public init(_ makeClient: @escaping @Sendable () -> SourceControlClient) { self.makeClient = makeClient } public static var unimplemented: Self { Self { .unimplemented } } public static func client( _ client: @autoclosure @escaping @Sendable () -> SourceControlClient ) -> Self { Self { client() } } } public extension Trait where Self == _DependenciesTrait { static func sourceControlClient(_ backend: SourceControlClientBackend) -> Self { .dependencies { $0.context = .test $0.sourceControl = backend.makeClient() } } } #endif