Skip to content
Snippets Groups Projects

Update Bindings

Merged Dariusz Rybicki requested to merge feature/update-bindings into development
1 file
+ 8
9
Compare changes
  • Side-by-side
  • Inline
import Bindings
import Bindings
 
import XCTestDynamicOverlay
public struct PasswordGenerator {
public struct GenerateSecret {
public var run: (Int) -> Data
public var run: (Int) -> Data
public func callAsFunction(numBytes: Int = 32) -> Data {
public func callAsFunction(numBytes: Int = 32) -> Data {
@@ -8,8 +9,8 @@ public struct PasswordGenerator {
@@ -8,8 +9,8 @@ public struct PasswordGenerator {
}
}
}
}
extension PasswordGenerator {
extension GenerateSecret {
public static let live = PasswordGenerator { numBytes in
public static let live = GenerateSecret { numBytes in
guard let secret = BindingsGenerateSecret(numBytes) else {
guard let secret = BindingsGenerateSecret(numBytes) else {
fatalError("BindingsGenerateSecret returned `nil`")
fatalError("BindingsGenerateSecret returned `nil`")
}
}
@@ -17,10 +18,8 @@ extension PasswordGenerator {
@@ -17,10 +18,8 @@ extension PasswordGenerator {
}
}
}
}
#if DEBUG
extension GenerateSecret {
extension PasswordGenerator {
public static let unimplemented = GenerateSecret(
public static let failing = PasswordGenerator { _ in
run: XCTUnimplemented("\(Self.self)")
fatalError("Not implemented")
)
}
}
}
#endif
Loading