Skip to content

Commit

Permalink
test availability
Browse files Browse the repository at this point in the history
  • Loading branch information
Azoy committed Jun 2, 2022
1 parent 489613e commit 3f704fe
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions Tests/RegexTests/MatchTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -797,19 +797,21 @@ extension RegexTests {
firstMatchTest(#"\p{Assigned}"#, input: "123abcXYZ", match: "1")
firstMatchTest(#"\p{ascii}"#, input: "123abcXYZ", match: "1")
firstMatchTest(#"\p{isAny}"#, input: "123abcXYZ", match: "1")

firstMatchTest(#"\p{sc=grek}"#, input: "123αβγxyz", match: "α")
firstMatchTest(#"\p{sc=isGreek}"#, input: "123αβγxyz", match: "α")
firstMatchTest(#"\p{Greek}"#, input: "123αβγxyz", match: "α")
firstMatchTest(#"\p{isGreek}"#, input: "123αβγxyz", match: "α")
firstMatchTest(#"\P{Script=Latn}"#, input: "abcαβγxyz", match: "α")
firstMatchTest(#"\p{script=Greek}"#, input: "123αβγxyz", match: "α")
firstMatchTest(#"\p{ISscript=isGreek}"#, input: "123αβγxyz", match: "α")
firstMatchTest(#"\p{scx=bamum}"#, input: "123ꚠꚡꚢxyz", match: "")
firstMatchTest(#"\p{ISBAMUM}"#, input: "123ꚠꚡꚢxyz", match: "")
firstMatchTest(#"\p{Script=Unknown}"#, input: "\u{10FFFF}", match: "\u{10FFFF}")
firstMatchTest(#"\p{scx=Gujr}"#, input: "\u{a839}", match: "\u{a839}")
firstMatchTest(#"\p{Gujr}"#, input: "\u{a839}", match: "\u{a839}")

if #available(SwiftStdlib 5.7, *) {
firstMatchTest(#"\p{sc=grek}"#, input: "123αβγxyz", match: "α")
firstMatchTest(#"\p{sc=isGreek}"#, input: "123αβγxyz", match: "α")
firstMatchTest(#"\p{Greek}"#, input: "123αβγxyz", match: "α")
firstMatchTest(#"\p{isGreek}"#, input: "123αβγxyz", match: "α")
firstMatchTest(#"\P{Script=Latn}"#, input: "abcαβγxyz", match: "α")
firstMatchTest(#"\p{script=Greek}"#, input: "123αβγxyz", match: "α")
firstMatchTest(#"\p{ISscript=isGreek}"#, input: "123αβγxyz", match: "α")
firstMatchTest(#"\p{scx=bamum}"#, input: "123ꚠꚡꚢxyz", match: "")
firstMatchTest(#"\p{ISBAMUM}"#, input: "123ꚠꚡꚢxyz", match: "")
firstMatchTest(#"\p{Script=Unknown}"#, input: "\u{10FFFF}", match: "\u{10FFFF}")
firstMatchTest(#"\p{scx=Gujr}"#, input: "\u{a839}", match: "\u{a839}")
firstMatchTest(#"\p{Gujr}"#, input: "\u{a839}", match: "\u{a839}")
}

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

0 comments on commit 3f704fe

Please sign in to comment.