Skip to content

Commit 51eebe1

Browse files
committed
[test] fix test of InlineArray initializer
1 parent fa87b3b commit 51eebe1

File tree

1 file changed

+0
-48
lines changed

1 file changed

+0
-48
lines changed

test/stdlib/Span/OutputSpanTests.swift

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -218,38 +218,6 @@ suite.test("InlineArray initialization underflow")
218218
}
219219
}
220220

221-
#if false
222-
suite.test("InlineArray initialization throws 0")
223-
.require(.stdlib_6_2).code {
224-
guard #available(SwiftStdlib 6.2, *) else { return }
225-
226-
enum LocalError: Error { case error }
227-
228-
class I {
229-
static public var count = 0
230-
init() { Self.count += 1 }
231-
deinit { Self.count -= 1 }
232-
}
233-
234-
let a: InlineArray<4, I>
235-
do throws(LocalError) {
236-
var c = 1
237-
a = try InlineArray(first: I()) {
238-
i throws(LocalError) in
239-
c += 1
240-
if c < 4 {
241-
return I()
242-
}
243-
print(I.count)
244-
throw LocalError.error
245-
}
246-
_ = a
247-
} catch {
248-
print(error, I.count)
249-
expectEqual(I.count, 0)
250-
}
251-
}
252-
253221
suite.test("InlineArray initialization throws")
254222
.require(.stdlib_6_2).code {
255223
guard #available(SwiftStdlib 6.2, *) else { return }
@@ -271,26 +239,10 @@ suite.test("InlineArray initialization throws")
271239
o.append(I())
272240
o.append(I())
273241
expectEqual(I.count, 4)
274-
print(I.count)
275242
throw LocalError.error
276243
}
277244
_ = a
278245
} catch {
279-
print(error, I.count)
280246
expectEqual(I.count, 0)
281247
}
282248
}
283-
#endif
284-
285-
suite.test("InlineArray consumed")
286-
.require(.stdlib_6_2).code {
287-
guard #available(SwiftStdlib 6.2, *) else { return }
288-
289-
let a: InlineArray<4, Int> = [1, 2, 3, 4]
290-
let b = Array(capacity: 20, initializingWith: {
291-
$0.append(consuming: a)
292-
})
293-
expectEqual(a.count, b.count)
294-
let i = a.indices.randomElement()!
295-
expectEqual(b[i], a[i])
296-
}

0 commit comments

Comments
 (0)