Adopted Array(capacity:) for the read wrappers throughout the library to adapt to Swift 6.4.
This commit is contained in:
@@ -345,6 +345,19 @@ struct WrapperTests {
|
||||
#expect(Mock.eventCount("close") == 1)
|
||||
}
|
||||
|
||||
@Test func fileHandleReadLengthReturnsOnlyTheBytesRead() throws {
|
||||
let handle = try File.Handle(path: "save.dat", mode: [.read, .readData])
|
||||
|
||||
Mock.fileReadLimit = 3
|
||||
#expect(try handle.read(length: 8) == [0xAB, 0xAB, 0xAB])
|
||||
|
||||
Mock.fileReadLimit = 0
|
||||
#expect(try handle.read(length: 8).isEmpty)
|
||||
|
||||
Mock.fileReadLimit = -1
|
||||
#expect(throws: PlaydateError.self) { try handle.read(length: 8) }
|
||||
}
|
||||
|
||||
// MARK: JSON
|
||||
|
||||
@Test func jsonDecodeBuildsTheValueTree() throws {
|
||||
|
||||
Reference in New Issue
Block a user