Revert "Revert "[Regex] Switch regex match to Swift tuples.""

This commit is contained in:
Richard Wei
2022-02-11 01:32:45 -08:00
committed by GitHub
parent f75ed39f97
commit 1b83efb512
12 changed files with 41 additions and 94 deletions

View File

@@ -47,7 +47,7 @@ RegexBasicTests.test("Captures") {
"""
let regex = '/([0-9A-F]+)(?:\.\.([0-9A-F]+))?\s+;\s+(\w+).*/'
// Test inferred type.
let _: Regex<Tuple4<Substring, Substring, Substring?, Substring>>.Type
let _: Regex<(Substring, Substring, Substring?, Substring)>.Type
= type(of: regex)
let match1 = input.expectMatch(regex)
expectEqual(input[...], input[match1.range])