[test] Update regex literal tests

This commit is contained in:
Hamish Knight
2022-04-04 11:51:41 +01:00
parent 6af73245c6
commit 51130bfb07
5 changed files with 30 additions and 49 deletions

View File

@@ -12,7 +12,7 @@ extension String {
file: String = #file,
line: UInt = #line
) -> Regex<T>.Match {
guard let result = match(regex) else {
guard let result = matchWhole(regex) else {
expectUnreachable("Failed match", file: file, line: line)
fatalError()
}
@@ -35,7 +35,9 @@ RegexBasicTests.test("Basic") {
RegexBasicTests.test("Modern") {
let input = "aabccd"
let match1 = input.expectMatch(#|a a bc c /*hello*/ .|#)
let match1 = input.expectMatch(#/
a a bc c (?#hello) . # comment
/#)
expectEqual("aabccd", match1.0)
expectTrue("aabccd" == match1.output)
}