Adopted Span for the setTiles wrapper in the library to adapt to Swift 6.4.
This commit is contained in:
@@ -99,6 +99,16 @@ struct WrapperTests {
|
||||
#expect(visited == 1)
|
||||
}
|
||||
|
||||
@Test func tileMapSetTilesPassesTheCallersStorageWithoutCopying() {
|
||||
let tileMap = Graphics.TileMap()
|
||||
let indexes: [UInt16] = [1, 2, 3, 4, 5, 6]
|
||||
tileMap.setTiles(indexes, rowWidth: 3)
|
||||
|
||||
#expect(Mock.events.contains("setTiles(6,3)"))
|
||||
let storage = indexes.withUnsafeBufferPointer { $0.baseAddress }
|
||||
#expect(UnsafePointer(Mock.tilesPointer) == storage)
|
||||
}
|
||||
|
||||
// MARK: Sprite
|
||||
|
||||
@Test func spriteUserdataRecoversWrapperInCallbacks() {
|
||||
|
||||
Reference in New Issue
Block a user