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
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.
Finish editing this message first!
Please register or to comment