Skip to content

Commit c8ac780

Browse files
committed
If def script tests out for macOS
1 parent 489613e commit c8ac780

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Tests/RegexTests/MatchTests.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,10 @@ extension RegexTests {
664664
firstMatchTest("[[:isALNUM:]]", input: "[[:alnum:]]", match: "a")
665665
firstMatchTest("[[:AL_NUM:]]", input: "[[:alnum:]]", match: "a")
666666

667+
// FIXME: Remove this once macOS CI is running 13.0
668+
#if os(Linux)
667669
firstMatchTest("[[:script=Greek:]]", input: "123αβγxyz", match: "α")
670+
#endif
668671

669672
func scalar(_ u: UnicodeScalar) -> UInt32 { u.value }
670673

@@ -798,6 +801,8 @@ extension RegexTests {
798801
firstMatchTest(#"\p{ascii}"#, input: "123abcXYZ", match: "1")
799802
firstMatchTest(#"\p{isAny}"#, input: "123abcXYZ", match: "1")
800803

804+
// FIXME: Remove this once macOS CI is running 13.0
805+
#if os(Linux)
801806
firstMatchTest(#"\p{sc=grek}"#, input: "123αβγxyz", match: "α")
802807
firstMatchTest(#"\p{sc=isGreek}"#, input: "123αβγxyz", match: "α")
803808
firstMatchTest(#"\p{Greek}"#, input: "123αβγxyz", match: "α")
@@ -810,6 +815,7 @@ extension RegexTests {
810815
firstMatchTest(#"\p{Script=Unknown}"#, input: "\u{10FFFF}", match: "\u{10FFFF}")
811816
firstMatchTest(#"\p{scx=Gujr}"#, input: "\u{a839}", match: "\u{a839}")
812817
firstMatchTest(#"\p{Gujr}"#, input: "\u{a839}", match: "\u{a839}")
818+
#endif
813819

814820
firstMatchTest(#"\p{alpha}"#, input: "123abcXYZ", match: "a")
815821
firstMatchTest(#"\P{alpha}"#, input: "123abcXYZ", match: "1")

Tests/RegexTests/UTS18Tests.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ extension UTS18Tests {
122122

123123
// Script and Script_Extensions
124124
// U+3042 あ HIRAGANA LETTER A Hira {Hira}
125+
// FIXME: Remove this once macOS CI is running 13.0
126+
#if os(Linux)
125127
XCTAssertTrue("\u{3042}".contains(regex(#"\p{Hira}"#)))
126128
XCTAssertTrue("\u{3042}".contains(regex(#"\p{sc=Hira}"#)))
127129
XCTAssertTrue("\u{3042}".contains(regex(#"\p{scx=Hira}"#)))
@@ -133,6 +135,7 @@ extension UTS18Tests {
133135
XCTAssertTrue("\u{30FC}".contains(regex(#"\p{scx=Kana}"#)))
134136
XCTAssertFalse("\u{30FC}".contains(regex(#"\p{sc=Hira}"#)))
135137
XCTAssertFalse("\u{30FC}".contains(regex(#"\p{sc=Kana}"#)))
138+
#endif
136139

137140
// Uppercase, etc
138141
expectFirstMatch(input, regex(#"\p{Uppercase}+"#), input[pos: ..<3])
@@ -144,10 +147,13 @@ extension UTS18Tests {
144147
expectFirstMatch(input, regex(#"\p{whitespace}+"#), input[pos: 12..<13])
145148

146149
// Block vs Writing System
150+
// FIXME: Remove this once macOS CI is running 13.0
151+
#if os(Linux)
147152
let greekScalar = "Θ" // U+0398
148153
let greekExtendedScalar = "" // U+1F00
149154
XCTAssertTrue(greekScalar.contains(regex(#"\p{Greek}"#)))
150155
XCTAssertTrue(greekExtendedScalar.contains(regex(#"\p{Greek}"#)))
156+
#endif
151157
}
152158

153159
func testProperties_XFail() {
@@ -536,8 +542,11 @@ extension UTS18Tests {
536542
XCTAssertTrue("a".contains(regex(#"\p{ASCII}"#)))
537543

538544
// Script (Script_Extensions)
545+
// FIXME: Remove this once macOS CI is running 13.0
546+
#if os(Linux)
539547
XCTAssertTrue("a".contains(regex(#"\p{script=latin}"#)))
540548
XCTAssertTrue("".contains(regex(#"\p{script=hangul}"#)))
549+
#endif
541550

542551
// White_Space
543552
XCTAssertTrue(" ".contains(regex(#"\p{whitespace}"#)))

0 commit comments

Comments
 (0)