Skip to content

Commit 38b3c25

Browse files
committed
[test] XFAIL some String tests on older Apple OSs
1 parent 6cc6f4f commit 38b3c25

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

โ€Žtest/stdlib/NSSlowString.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ tests.test("Iterator") {
5757
expectEqualSequence(opaque.utf8.reversed(), native.utf8.reversed())
5858
}
5959

60-
tests.test("Unicode 9 grapheme breaking") {
60+
tests.test("Unicode 9 grapheme breaking")
61+
.xfail(.osxMinor(10, 9, reason: "Mac OS X 10.9 has an old version of ICU"))
62+
.xfail(.iOSMajor(7, reason: "iOS 7 has an old version of ICU"))
63+
.code {
6164

6265
// Test string lengths that correspond to smaller than our fixed size code
6366
// unit buffer, larger than it, and exactly it.
@@ -69,7 +72,11 @@ tests.test("Unicode 9 grapheme breaking") {
6972
check(strJustRight as String, expectedCount: 5, expectedCodeUnitCount: 16)
7073
}
7174

72-
tests.test("Zalgo") {
75+
tests.test("Zalgo")
76+
.xfail(.osxMinor(10, 9, reason: "Mac OS X 10.9 has an old version of ICU"))
77+
.xfail(.iOSMajor(7, reason: "iOS 7 has an old version of ICU"))
78+
.code {
79+
7380
// Check that we handle absurdly long graphemes
7481
var zalgo = "a๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆc"
7582
for combo in 0x300...0x36f {

โ€Žtest/stdlib/subString.swift

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ SubstringTests.test("Equality") {
2929
expectEqual("fg" as String, s.suffix(2))
3030

3131
#if _runtime(_ObjC)
32-
let emoji: String = s + "๐Ÿ˜„๐Ÿ‘๐Ÿฝ๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ™ˆ" + "๐Ÿ˜ก๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡จ๐Ÿ‡ฆ๐Ÿ‡ฎ๐Ÿ‡ณ"
3332
expectTrue(s == s[...])
3433
expectTrue(s[...] == s)
3534
expectTrue(s.dropFirst(2) != s)
@@ -43,18 +42,29 @@ SubstringTests.test("Equality") {
4342
expectNotEqual(s.dropLast(2), s.dropLast(1))
4443
expectEqual(s.dropFirst(1), s.dropFirst(1))
4544
expectTrue(s != s[...].dropFirst(1))
45+
#endif
46+
47+
// equatable conformance
48+
expectTrue("one,two,three".split(separator: ",").contains("two"))
49+
expectTrue("one,two,three".split(separator: ",") == ["one","two","three"])
50+
}
51+
52+
#if _runtime(_ObjC)
53+
SubstringTests.test("Equality/Emoji")
54+
.xfail(.osxMinor(10, 9, reason: "Mac OS X 10.9 has an old ICU"))
55+
.xfail(.iOSMajor(7, reason: "iOS 7 has an old ICU"))
56+
.code {
57+
let s = "abcdefg"
58+
let emoji: String = s + "๐Ÿ˜„๐Ÿ‘๐Ÿฝ๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ™ˆ" + "๐Ÿ˜ก๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡จ๐Ÿ‡ฆ๐Ÿ‡ฎ๐Ÿ‡ณ"
4659
let i = emoji.firstIndex(of: "๐Ÿ˜„")!
4760
expectEqual("๐Ÿ˜„๐Ÿ‘๐Ÿฝ" as String, emoji[i...].prefix(2))
4861
expectTrue("๐Ÿ˜„๐Ÿ‘๐Ÿฝ๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ™ˆ๐Ÿ˜ก๐Ÿ‡ง๐Ÿ‡ช" as String == emoji[i...].dropLast(2))
4962
expectTrue("๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ™ˆ๐Ÿ˜ก๐Ÿ‡ง๐Ÿ‡ช" as String == emoji[i...].dropLast(2).dropFirst(2))
5063
expectTrue(s as String != emoji[i...].dropLast(2).dropFirst(2))
5164
expectEqualSequence("๐Ÿ˜„๐Ÿ‘๐Ÿฝ๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ™ˆ๐Ÿ˜ก๐Ÿ‡ง๐Ÿ‡ช" as String, emoji[i...].dropLast(2))
5265
expectEqualSequence("๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ™ˆ๐Ÿ˜ก๐Ÿ‡ง๐Ÿ‡ช" as String, emoji[i...].dropLast(2).dropFirst(2))
53-
#endif
54-
// equatable conformance
55-
expectTrue("one,two,three".split(separator: ",").contains("two"))
56-
expectTrue("one,two,three".split(separator: ",") == ["one","two","three"])
5766
}
67+
#endif
5868

5969
SubstringTests.test("Comparison") {
6070
var s = "abc"

0 commit comments

Comments
ย (0)