Skip to content

Commit 019919d

Browse files
authored
Merge pull request swiftlang#20381 from milseman/oldOS
[test] Fixup some tests for older OSes and other inconsequential changes
2 parents f3dda28 + 0ca620a commit 019919d

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

stdlib/public/core/StringStorage.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ private func determineCodeUnitCapacity(_ desiredCapacity: Int) -> Int {
187187

188188
// Creation
189189
extension _StringStorage {
190-
@inline(never) // rdar://problem/44542202
191190
@_effects(releasenone)
192191
private static func create(
193192
realCodeUnitCapacity: Int, countAndFlags: CountAndFlags

test/stdlib/Character.swift

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,17 @@ testCharacters += [
105105
"\u{00a9}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 10 bytes
106106
]
107107

108-
// Only run it on ObjC platforms. Supported Linux versions do not have a
109-
// recent enough ICU
110-
#if _runtime(_ObjC)
111-
testCharacters += [
112-
"\u{00a9}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 12 bytes
113-
"\u{00a9}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 14 bytes
114-
"\u{00a9}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 16 bytes
115-
116-
"👩🏽‍💼", // UTF-8: 15 bytes
117-
"👩‍👩‍👦‍👦", // UTF-8: 25 bytes
118-
]
119-
#endif
108+
// Only run it on recent enough versions of ICU
109+
if #available(iOS 11.0, macOS 10.13, tvOS 11.0, watchOS 4.0, *) {
110+
testCharacters += [
111+
"\u{00a9}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 12 bytes
112+
"\u{00a9}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 14 bytes
113+
"\u{00a9}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 16 bytes
114+
115+
"👩🏽‍💼", // UTF-8: 15 bytes
116+
"👩‍👩‍👦‍👦", // UTF-8: 25 bytes
117+
]
118+
}
120119

121120
func randomGraphemeCluster(_ minSize: Int, _ maxSize: Int) -> String {
122121
let n = Int.random(in: (minSize + 1) ..< maxSize)

test/stdlib/NewString.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func nonASCII() {
108108

109109
// The storage of the slice implements NSString directly
110110
// CHECK-NOT: @[[utf16address]] = "❅❆❄︎⛄️"
111-
// CHECK-NEXT: Swift._StringStorage@[[sliceAddress]] = "❅❆❄︎⛄️"
111+
// CHECK-NEXT: {{.*}}StringStorage@[[sliceAddress]] = "❅❆❄︎⛄️"
112112
let nsSlice = slice as NSString
113113
print(" \(repr(nsSlice))")
114114

0 commit comments

Comments
 (0)