Made File.Handle a non-copyable struct in the library to adopt Swift 6.4.
This commit is contained in:
@@ -422,6 +422,19 @@ enum Mock {
|
||||
private static func installJSON() {
|
||||
jsonAPI.initialize(to: playdate_json())
|
||||
|
||||
// Pulls one chunk through the reader, as the OS would, and decodes
|
||||
// it as `null`.
|
||||
jsonAPI.pointee.decode = { _, reader, outval in
|
||||
var buffer = [UInt8](repeating: 0, count: 16)
|
||||
let count = buffer.withUnsafeMutableBufferPointer { buffer in
|
||||
reader.read?(reader.userdata, buffer.baseAddress, Int32(buffer.count)) ?? -1
|
||||
}
|
||||
Mock.record("decode(\(count))")
|
||||
outval?.pointee = json_value()
|
||||
outval?.pointee.type = CChar(kJSONNull.rawValue)
|
||||
return 1
|
||||
}
|
||||
|
||||
jsonAPI.pointee.decodeString = { decoder, _, outval in
|
||||
guard let decoder else { return 0 }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user