File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -69,3 +69,18 @@ public func run_DropLastAnySequence(_ N: Int) {
69
69
}
70
70
}
71
71
}
72
+
73
+ @inline ( never)
74
+ public func run_DropLastArray( _ N: Int ) {
75
+ let s = Array ( 0 ..< sequenceCount)
76
+ for _ in 1 ... 20 * N {
77
+ for _ in 1 ... reps {
78
+ var result = 0
79
+ for element in s. dropLast ( dropCount) {
80
+ result += element
81
+ }
82
+ CheckResults ( result == sumCount,
83
+ " IncorrectResults in DropLastArray: \( result) != \( sumCount) " )
84
+ }
85
+ }
86
+ }
Original file line number Diff line number Diff line change @@ -69,3 +69,17 @@ public func run_SuffixAnySequence(_ N: Int) {
69
69
}
70
70
}
71
71
72
+ @inline ( never)
73
+ public func run_SuffixArray( _ N: Int ) {
74
+ let s = Array ( 0 ..< sequenceCount)
75
+ for _ in 1 ... 20 * N {
76
+ for _ in 1 ... reps {
77
+ var result = 0
78
+ for element in s. suffix ( suffixCount) {
79
+ result += element
80
+ }
81
+ CheckResults ( result == sumCount,
82
+ " IncorrectResults in SuffixArray: \( result) != \( sumCount) " )
83
+ }
84
+ }
85
+ }
Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ precommitTests = [
164
164
" DictionarySwap " : run_DictionarySwap,
165
165
" DictionarySwapOfObjects " : run_DictionarySwapOfObjects,
166
166
" DropLastAnySequence " : run_DropLastAnySequence,
167
+ " DropLastArray " : run_DropLastArray,
167
168
" DropLastCountableRange " : run_DropLastCountableRange,
168
169
" DropLastSequence " : run_DropLastSequence,
169
170
" ErrorHandling " : run_ErrorHandling,
@@ -279,6 +280,7 @@ precommitTests = [
279
280
" StringWalk " : run_StringWalk,
280
281
" StringWithCString " : run_StringWithCString,
281
282
" SuffixAnySequence " : run_SuffixAnySequence,
283
+ " SuffixArray " : run_SuffixArray,
282
284
" SuffixCountableRange " : run_SuffixCountableRange,
283
285
" SuffixSequence " : run_SuffixSequence,
284
286
" SuperChars " : run_SuperChars,
You can’t perform that action at this time.
0 commit comments