Skip to content

Commit bd05541

Browse files
author
Lance Parker
committed
Make the reserve capacity test use GT/GE rather than testing for a speicific value
1 parent a386f74 commit bd05541

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

validation-test/stdlib/Arrays.swift.gyb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,26 @@ ArrayTestSuite.test("valueDestruction") {
115115

116116
ArrayTestSuite.test("capacity/reserveCapacity(_:)") {
117117
var a1 = [1010, 1020, 1030]
118-
expectEqual(3, a1.capacity)
118+
expectGE(a1.capacity, 3)
119119
a1.append(1040)
120-
expectEqual(6, a1.capacity)
120+
expectGT(a1.capacity, 3)
121121

122122
// Reserving new capacity jumps up to next limit.
123123
a1.reserveCapacity(7)
124-
expectEqual(8, a1.capacity)
124+
expectGE(a1.capacity, 7)
125125

126126
// Can reserve right up to a limit.
127127
a1.reserveCapacity(24)
128-
expectEqual(24, a1.capacity)
128+
expectGE(a1.capacity, 24)
129129

130130
// Fill up to the limit, no reallocation.
131131
for v in stride(from: 50, through: 240, by: 10).lazy.map({ 1000 + $0 }) {
132132
a1.append(v)
133133
}
134134
expectEqual(24, a1.count)
135-
expectEqual(24, a1.capacity)
135+
expectGE(a1.capacity, 24)
136136
a1.append(1250)
137-
expectEqual(48, a1.capacity)
137+
expectGT(a1.capacity, 24)
138138
}
139139

140140
ArrayTestSuite.test("init(arrayLiteral:)") {

0 commit comments

Comments
 (0)