Skip to content
Snippets Groups Projects
Commit a0916987 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add UpdateCommonErrors functor

parent 71f3ce21
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!20Update Bindings.xcframework
This commit is part of merge request !20. Comments created here will be created in the context of that merge request.
import Bindings
import XCTestDynamicOverlay
public struct UpdateCommonErrors {
public var run: (String) throws -> Void
public func callAsFunction(jsonFile: String) throws {
try run(jsonFile)
}
}
extension UpdateCommonErrors {
public static let live = UpdateCommonErrors { jsonFile in
var error: NSError?
let result = BindingsUpdateCommonErrors(
jsonFile,
&error
)
if let error = error {
throw error
}
guard result else {
fatalError("BindingsUpdateCommonErrors returned `false` without providing error")
}
}
}
extension UpdateCommonErrors {
public static let unimplemented = UpdateCommonErrors(
run: XCTUnimplemented("\(Self.self)")
)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment