mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Swift: Additional test cases.
This commit is contained in:
@@ -6549,3 +6549,53 @@ regex.swift:
|
||||
|
||||
# 221| [RegExpStar] .*
|
||||
#-----| 0 -> [RegExpDot] .
|
||||
|
||||
# 227| [RegExpGroup] (?i-s)
|
||||
#-----| 0 -> [RegExpConstant, RegExpNormalChar] i-s
|
||||
|
||||
# 227| [RegExpSequence] (?i-s)abc
|
||||
#-----| 0 -> [RegExpGroup] (?i-s)
|
||||
#-----| 1 -> [RegExpConstant, RegExpNormalChar] abc
|
||||
|
||||
# 227| [RegExpConstant, RegExpNormalChar] i-s
|
||||
|
||||
# 227| [RegExpConstant, RegExpNormalChar] abc
|
||||
|
||||
# 230| [RegExpConstant, RegExpNormalChar] abc
|
||||
|
||||
# 230| [RegExpSequence] abc(?i)def
|
||||
#-----| 0 -> [RegExpConstant, RegExpNormalChar] abc
|
||||
#-----| 1 -> [RegExpGroup] (?i)
|
||||
#-----| 2 -> [RegExpConstant, RegExpNormalChar] def
|
||||
|
||||
# 230| [RegExpGroup] (?i)
|
||||
#-----| 0 -> [RegExpConstant, RegExpNormalChar] i
|
||||
|
||||
# 230| [RegExpConstant, RegExpNormalChar] i
|
||||
|
||||
# 230| [RegExpConstant, RegExpNormalChar] def
|
||||
|
||||
# 231| [RegExpConstant, RegExpNormalChar] abc
|
||||
|
||||
# 231| [RegExpSequence] abc(?i:def)ghi
|
||||
#-----| 0 -> [RegExpConstant, RegExpNormalChar] abc
|
||||
#-----| 1 -> [RegExpGroup] (?i:def)
|
||||
#-----| 2 -> [RegExpConstant, RegExpNormalChar] ghi
|
||||
|
||||
# 231| [RegExpGroup] (?i:def)
|
||||
#-----| 0 -> [RegExpConstant, RegExpNormalChar] i:def
|
||||
|
||||
# 231| [RegExpConstant, RegExpNormalChar] i:def
|
||||
|
||||
# 231| [RegExpConstant, RegExpNormalChar] ghi
|
||||
|
||||
# 232| [RegExpGroup] (?i)
|
||||
#-----| 0 -> [RegExpConstant, RegExpNormalChar] i
|
||||
|
||||
# 232| [RegExpConstant, RegExpNormalChar] i
|
||||
|
||||
# 232| [RegExpConstant, RegExpNormalChar] abc
|
||||
|
||||
# 232| [RegExpConstant, RegExpNormalChar] -i
|
||||
|
||||
# 232| [RegExpConstant, RegExpNormalChar] def
|
||||
|
||||
@@ -223,4 +223,11 @@ func myRegexpMethodsTests(b: Bool, str_unknown: String) throws {
|
||||
_ = input.replacingOccurrences(of: ".*", with: "", options: [.regularExpression, .caseInsensitive]) // $ MISSING: regex=.* input=input modes=IGNORECASE
|
||||
|
||||
_ = NSString(string: "abc").replacingOccurrences(of: ".*", with: "", options: [.regularExpression, .caseInsensitive], range: NSMakeRange(0, inputNS.length)) // $ MISSING: regex=.* input=inputNS modes=IGNORECASE
|
||||
|
||||
_ = try Regex("(?i-s)abc").firstMatch(in: input) // $ input=input regex=(?i-s)abc MISSING: modes=IGNORECASE SPURIOUS: modes="DOTALL | IGNORECASE"
|
||||
|
||||
// these cases use parse modes on localized areas of the regex, which we don't currently support
|
||||
_ = try Regex("abc(?i)def").firstMatch(in: input) // $ input=input modes=IGNORECASE regex=abc(?i)def
|
||||
_ = try Regex("abc(?i:def)ghi").firstMatch(in: input) // $ input=input modes=IGNORECASE regex=abc(?i:def)ghi
|
||||
_ = try Regex("(?i)abc(?-i)def").firstMatch(in: input) // $ input=input modes=IGNORECASE regex=(?i)abc(?-i)def SPURIOUS: hasParseFailure=
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user