mirror of
https://github.com/apple/swift-collections
synced 2026-11-28 05:04:21 +00:00
[BasicContainers] Add regression tests for RigidArray/UniqueArray’s expected memory layout
This commit is contained in:
2 files changed
+12
No files matched your search
@@ -66,6 +66,12 @@ internal func expectRigidArrayContents<
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
class RigidArrayTests: CollectionTestCase {
|
||||
func test_memory_layout() {
|
||||
let word = MemoryLayout<Int>.size
|
||||
expectEqual(MemoryLayout<RigidArray<Int>>.stride, 3 * word)
|
||||
expectEqual(MemoryLayout<RigidArray<Int>?>.stride, 3 * word)
|
||||
}
|
||||
|
||||
func test_validate_Container() {
|
||||
withSomeArrayLayouts("layout", ofCapacities: [0, 10, 100]) { layout in
|
||||
withLifetimeTracking { tracker in
|
||||
|
||||
@@ -68,6 +68,12 @@ public func expectUniqueArrayContents<
|
||||
|
||||
@available(SwiftStdlib 6.2, *)
|
||||
class UniqueArrayTests: CollectionTestCase {
|
||||
func test_memory_layout() {
|
||||
let word = MemoryLayout<Int>.size
|
||||
expectEqual(MemoryLayout<UniqueArray<Int>>.stride, 3 * word)
|
||||
expectEqual(MemoryLayout<UniqueArray<Int>?>.stride, 3 * word)
|
||||
}
|
||||
|
||||
func test_validate_Container() {
|
||||
withSomeArrayLayouts("layout", ofCapacities: [0, 10, 100]) { layout in
|
||||
withLifetimeTracking { tracker in
|
||||
|
||||
Reference in new issue
Block a user