We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7e5ecfd + fb52491 commit b82fed4Copy full SHA for b82fed4
validation-test/stdlib/String.swift
@@ -2380,7 +2380,8 @@ StringTests.test("String.CoW.reserveCapacity") {
2380
let preGrowCapacity = str.capacity
2381
2382
// Growth shouldn't be linear
2383
- str.append(contentsOf: String(repeating: "z", count: 20))
+ let newElementCount = (preGrowCapacity - str.count) + 10
2384
+ str.append(contentsOf: String(repeating: "z", count: newElementCount))
2385
expectGE(str.capacity, preGrowCapacity * 2)
2386
2387
// Capacity can shrink when copying, but not below the count
@@ -2407,7 +2408,6 @@ StringTests.test("NSString.CoW.reserveCapacity") {
2407
2408
var copy2 = str2
2409
copy2.append(contentsOf: String(repeating: "z", count: 10))
2410
expectGE(copy2.capacity, 30)
- expectLT(copy2.capacity, 40)
2411
#endif
2412
}
2413
0 commit comments