File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ //===--- SlabSpan.swift ---------------------------------------------------===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2025 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ //===----------------------------------------------------------------------===//
12
+
13
+ // RUN: %target-run-stdlib-swift(-enable-experimental-feature LifetimeDependence -enable-experimental-feature Span -enable-experimental-feature AddressableTypes -enable-experimental-feature ValueGenerics)
14
+
15
+ // REQUIRES: executable_test
16
+
17
+ import StdlibUnittest
18
+
19
+ var suite = TestSuite ( " SlabStorageProperty " )
20
+ defer { runAllTests ( ) }
21
+
22
+ suite. test ( " Slab.storage property " )
23
+ . skip ( . custom(
24
+ { if #available( SwiftStdlib 6 . 1 , * ) { false } else { true } } ,
25
+ reason: " Requires Swift 6.1's standard library "
26
+ ) )
27
+ . code {
28
+ guard #available( SwiftStdlib 6 . 1 , * ) else { return }
29
+
30
+ var s = Slab< 5 , Int > ( repeating: 0 )
31
+ s [ 3 ] = . random( in: 0 ..< 1000 )
32
+ let storage = s. storage
33
+ expectEqual ( storage. count, s. count)
34
+ for i in 0 ..< s. count {
35
+ expectEqual ( storage [ i] , s [ i] )
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments