mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Make String.UTF8View bidirectional
This is a step along the way toward handling backward-compatiblity of UTF8View slicing and preventing inadvertent creation of String instances that keep inaccessible memory alive.
This commit is contained in:
@@ -59,10 +59,10 @@ StringTests.test("AssociatedTypes-UTF8View") {
|
||||
expectCollectionAssociatedTypes(
|
||||
collectionType: View.self,
|
||||
iteratorType: View.Iterator.self,
|
||||
subSequenceType: Slice<View>.self,
|
||||
subSequenceType: BidirectionalSlice<View>.self,
|
||||
indexType: View.Index.self,
|
||||
indexDistanceType: Int.self,
|
||||
indicesType: DefaultIndices<View>.self)
|
||||
indicesType: DefaultBidirectionalIndices<View>.self)
|
||||
}
|
||||
|
||||
StringTests.test("AssociatedTypes-UTF16View") {
|
||||
|
||||
@@ -728,8 +728,7 @@ tests.test("String.UTF8View/Collection")
|
||||
.forEach(in: utfTests) {
|
||||
test in
|
||||
|
||||
// FIXME(ABI)#72 : should be `checkBidirectionalCollection`.
|
||||
checkForwardCollection(test.utf8, test.string.utf8) { $0 == $1 }
|
||||
checkBidirectionalCollection(test.utf8, test.string.utf8) { $0 == $1 }
|
||||
}
|
||||
|
||||
tests.test("String.UTF16View/BidirectionalCollection")
|
||||
|
||||
Reference in New Issue
Block a user