Skip to content

Commit 71b6d99

Browse files
committed
[test] fix a test warning
1 parent 56c6887 commit 71b6d99

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

validation-test/stdlib/UnsafeBufferPointerSlices.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,12 @@ UnsafeMutableBufferPointerSliceTests.test(
280280

281281
var a = UnsafeMutableBufferPointer<String>.allocate(capacity: c)
282282
defer { a.deallocate() }
283-
a.initialize(fromContentsOf: Array(repeating: ".", count: c))
283+
var i: Int? = a.initialize(fromContentsOf: Array(repeating: ".", count: c))
284284
defer { a.deinitialize() }
285+
expectEqual(i, c)
286+
expectTrue(a.allSatisfy({ $0 == "." }))
285287

286-
var i = a.withContiguousMutableStorageIfAvailable {
288+
i = a.withContiguousMutableStorageIfAvailable {
287289
$0.update(fromContentsOf: Array(repeating: " ", count: c))
288290
}
289291
expectEqual(i, c)

0 commit comments

Comments
 (0)