@@ -127,9 +127,9 @@ func myRegexpMethodsTests(b: Bool, str_unknown: String) throws {
127
127
// --- StringProtocol ---
128
128
129
129
_ = input. range ( of: " .* " , options: . regularExpression, range: nil , locale: nil ) // $ regex=.* input=input
130
- _ = input. range ( of: " .* " , options: . literal, range: nil , locale: nil ) // (not a regular expression)
130
+ _ = input. range ( of: " .* " , options: . literal, range: nil , locale: nil ) // $ SPURIOUS: unevaluated-regex=.* (not a regular expression)
131
131
_ = input. replacingOccurrences ( of: " .* " , with: " " , options: . regularExpression) // $ regex=.* input=input
132
- _ = input. replacingOccurrences ( of: " .* " , with: " " , options: . literal) // (not a regular expression)
132
+ _ = input. replacingOccurrences ( of: " .* " , with: " " , options: . literal) // $ SPURIOUS: unevaluated-regex=.* (not a regular expression)
133
133
134
134
// --- NSRegularExpression ---
135
135
@@ -151,9 +151,9 @@ func myRegexpMethodsTests(b: Bool, str_unknown: String) throws {
151
151
_ = inputNS. range ( of: " .* " , options: [ . regularExpression] ) // $ regex=.* input=inputNS
152
152
_ = inputNS. range ( of: " .* " , options: regexOptions) // $ regex=.* input=inputNS
153
153
_ = inputNS. range ( of: " .* " , options: regexOptions2) // $ regex=.* input=inputNS modes=IGNORECASE
154
- _ = inputNS. range ( of: " .* " , options: . literal) // (not a regular expression)
154
+ _ = inputNS. range ( of: " .* " , options: . literal) // $ SPURIOUS: unevaluated-regex=.* (not a regular expression)
155
155
_ = inputNS. replacingOccurrences ( of: " .* " , with: " " , options: . regularExpression, range: NSMakeRange ( 0 , inputNS. length) ) // $ regex=.* input=inputNS
156
- _ = inputNS. replacingOccurrences ( of: " .* " , with: " " , options: . literal, range: NSMakeRange ( 0 , inputNS. length) ) // (not a regular expression)
156
+ _ = inputNS. replacingOccurrences ( of: " .* " , with: " " , options: . literal, range: NSMakeRange ( 0 , inputNS. length) ) // $ SPURIOUS: unevaluated-regex=.* (not a regular expression)
157
157
158
158
// --- flow ---
159
159
@@ -252,4 +252,7 @@ func myRegexpMethodsTests(b: Bool, str_unknown: String) throws {
252
252
_ = input. replacingOccurrences ( of: " .* " , with: " " , options: myOptions2) // $ regex=.* input=input modes=IGNORECASE
253
253
_ = NSString ( string: " abc " ) . replacingOccurrences ( of: " .* " , with: " " , options: [ . regularExpression, . caseInsensitive] , range: NSMakeRange ( 0 , inputNS. length) ) // $ regex=.* input="call to NSString.init(string:)" modes=IGNORECASE
254
254
_ = NSString ( string: " abc " ) . replacingOccurrences ( of: " .* " , with: " " , options: myOptions2, range: NSMakeRange ( 0 , inputNS. length) ) // $ regex=.* input="call to NSString.init(string:)" modes=IGNORECASE
255
+
256
+ // Regex created but never evaluated
257
+ _ = try Regex ( " .* " ) // $ unevaluated-regex=.*
255
258
}
0 commit comments