File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
swift/ql/test/library-tests/regex Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -6254,3 +6254,22 @@ regex.swift:
6254
6254
# 157| [RegExpConstant, RegExpEscape] \n
6255
6255
6256
6256
# 158| [RegExpConstant, RegExpEscape] \n
6257
+
6258
+ # 168| [RegExpConstant, RegExpNormalChar] aa
6259
+
6260
+ # 168| [RegExpAlt] aa|bb
6261
+ #-----| 0 -> [RegExpConstant, RegExpNormalChar] aa
6262
+ #-----| 1 -> [RegExpConstant, RegExpNormalChar] bb
6263
+
6264
+ # 168| [RegExpConstant, RegExpNormalChar] bb
6265
+
6266
+ # 172| [RegExpConstant, RegExpNormalChar]
6267
+ # 172| bb
6268
+
6269
+ # 172| [RegExpConstant, RegExpNormalChar] aa
6270
+
6271
+ # 172| [RegExpAlt] aa|
6272
+ # 172| bb
6273
+ #-----| 0 -> [RegExpConstant, RegExpNormalChar] aa
6274
+ #-----| 1 -> [RegExpConstant, RegExpNormalChar]
6275
+ #-----| bb
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ class NSRegularExpression : NSObject {
98
98
//
99
99
// the focus for these tests is different ways of evaluating regexps.
100
100
101
- func myRegexpMethodsTests( b: Bool ) throws {
101
+ func myRegexpMethodsTests( b: Bool , str_unknown : String ) throws {
102
102
let input = " abcdef "
103
103
let regex = try Regex ( " .* " )
104
104
@@ -156,4 +156,21 @@ func myRegexpMethodsTests(b: Bool) throws {
156
156
_ = try Regex ( " \n " ) . firstMatch ( in: input) // $ regex=NEWLINE input=input
157
157
_ = try Regex ( " \\ n " ) . firstMatch ( in: input) // $ regex=\n input=input
158
158
_ = try Regex ( #"\n"# ) . firstMatch ( in: input) // $ regex=\n input=input
159
+
160
+ // --- interpolated values ---
161
+
162
+ let str_constant = " aa "
163
+ _ = try Regex ( " \( str_constant) )|bb " ) . firstMatch ( in: input) // $ input=input MISSING: regex=aa|bb
164
+ _ = try Regex ( " \( str_unknown) )|bb " ) . firstMatch ( in: input) // $ input=input
165
+
166
+ // --- multi-line ---
167
+
168
+ _ = try Regex ( """
169
+ aa|bb
170
+ """ ) . firstMatch ( in: input) // $ input=input regex=aa|bb
171
+
172
+ _ = try Regex ( """
173
+ aa|
174
+ bb
175
+ """ ) . firstMatch ( in: input) // $ input=input regex=aa|NEWLINEbb
159
176
}
You can’t perform that action at this time.
0 commit comments