Skip to content

Commit 9e9ef42

Browse files
committed
Swift: Add another test case.
1 parent 4a06394 commit 9e9ef42

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

swift/ql/test/library-tests/regex/regex.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,13 @@ func myRegexpMethodsTests(b: Bool) throws {
143143
_ = try either_regex.firstMatch(in: input) // $ regex=.* regex=.+ input=input
144144

145145
let base_str = "a"
146-
let append_regex = try Regex(base_str + "b")
147-
_ = try append_regex.firstMatch(in: input) // $ input=input MISSING: regex=ab
146+
let appended_regex = try Regex(base_str + "b")
147+
_ = try appended_regex.firstMatch(in: input) // $ input=input MISSING: regex=ab
148+
149+
let multiple_evaluated_regex = try Regex(#"([\w.]+)*"#)
150+
try _ = multiple_evaluated_regex.firstMatch(in: input) // $ input=input regex=([\w.]+)*
151+
try _ = multiple_evaluated_regex.prefixMatch(in: input) // $ input=input regex=([\w.]+)*
152+
try _ = multiple_evaluated_regex.wholeMatch(in: input) // $ input=input regex=([\w.]+)* MISSING: redos-vulnerable=
148153

149154
// --- escape sequences ---
150155

0 commit comments

Comments
 (0)