Skip to content

Commit 3677d8e

Browse files
committed
Added test of += matching .append(contentsOf:) to StdLibUnitTest
1 parent dbf4bf9 commit 3677d8e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

stdlib/private/StdlibCollectionUnittest/CheckRangeReplaceableCollectionType.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,19 @@ self.test("\(testNamePrefix).append(contentsOf:)/semantics") {
608608
}
609609
}
610610

611+
self.test("\(testNamePrefix).OperatorPlusEquals") {
612+
for test in appendContentsOfTests {
613+
var c = makeWrappedCollection(test.collection)
614+
let newElements =
615+
MinimalCollection(elements: test.newElements.map(wrapValue))
616+
c += newElements
617+
expectEqualSequence(
618+
test.expected,
619+
c.map { extractValue($0).value },
620+
stackTrace: SourceLocStack().with(test.loc))
621+
}
622+
}
623+
611624
//===----------------------------------------------------------------------===//
612625
// insert()
613626
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)