@@ -238,8 +238,10 @@ class RegexDSLTests: XCTestCase {
238
238
( " abcabc " , " abcabc " ) ,
239
239
( " abcABCaBc " , " abcABCaBc " ) ,
240
240
matchType: Substring . self, == ) {
241
- OneOrMore {
242
- " abc "
241
+ Regex {
242
+ OneOrMore {
243
+ " abc "
244
+ }
243
245
} . ignoresCase ( true )
244
246
}
245
247
@@ -251,8 +253,10 @@ class RegexDSLTests: XCTestCase {
251
253
( " abcabc " , " abcabc " ) ,
252
254
( " abcABCaBc " , " abcABCaBc " ) ,
253
255
matchType: Substring . self, == ) {
254
- OneOrMore {
255
- " abc "
256
+ Regex {
257
+ OneOrMore {
258
+ " abc "
259
+ }
256
260
}
257
261
. ignoresCase ( true )
258
262
. ignoresCase ( false )
@@ -268,9 +272,13 @@ class RegexDSLTests: XCTestCase {
268
272
( " abcabc " , " abcabc " ) ,
269
273
( " abcdeABCdeaBcde " , " abcdeABCdeaBcde " ) ,
270
274
matchType: Substring . self, == ) {
271
- OneOrMore {
272
- " abc " . ignoresCase ( true )
273
- Optionally ( " de " )
275
+ Regex {
276
+ OneOrMore {
277
+ Regex {
278
+ " abc "
279
+ } . ignoresCase ( true )
280
+ Optionally ( " de " )
281
+ }
274
282
}
275
283
. ignoresCase ( false )
276
284
}
@@ -307,11 +315,13 @@ class RegexDSLTests: XCTestCase {
307
315
" stop "
308
316
" "
309
317
310
- Capture {
311
- OneOrMore ( . word)
312
- Anchor . wordBoundary
313
- }
314
- . wordBoundaryKind ( . unicodeLevel1)
318
+ Regex {
319
+ Capture {
320
+ OneOrMore ( . word)
321
+ Anchor . wordBoundary
322
+ }
323
+ } . wordBoundaryKind ( . unicodeLevel1)
324
+
315
325
OneOrMore ( . any, . reluctant)
316
326
" stop "
317
327
}
@@ -321,15 +331,17 @@ class RegexDSLTests: XCTestCase {
321
331
matchType: ( Substring, Substring, Substring) . self, == ) {
322
332
Capture {
323
333
// Reluctant behavior due to option
324
- OneOrMore ( . anyOf( " abcd " ) )
325
- . repetitionBehavior ( . reluctant)
334
+ Regex {
335
+ OneOrMore ( . anyOf( " abcd " ) )
336
+ } . repetitionBehavior ( . reluctant)
326
337
}
327
338
ZeroOrMore ( " a " ... " z " )
328
339
329
340
Capture {
330
341
// Eager behavior due to explicit parameter, despite option
331
- OneOrMore ( . digit, . eager)
332
- . repetitionBehavior ( . reluctant)
342
+ Regex {
343
+ OneOrMore ( . digit, . eager)
344
+ } . repetitionBehavior ( . reluctant)
333
345
}
334
346
ZeroOrMore ( . digit)
335
347
}
@@ -338,10 +350,11 @@ class RegexDSLTests: XCTestCase {
338
350
( " abcdefg " , ( " abcdefg " , " abcdefg " ) ) ,
339
351
( " abcdéfg " , ( " abcdéfg " , " abcd " ) ) ,
340
352
matchType: ( Substring, Substring) . self, == ) {
341
- Capture {
342
- OneOrMore ( . word)
343
- }
344
- . asciiOnlyWordCharacters ( )
353
+ Regex {
354
+ Capture {
355
+ OneOrMore ( . word)
356
+ }
357
+ } . asciiOnlyWordCharacters ( )
345
358
346
359
ZeroOrMore ( . any)
347
360
}
@@ -372,8 +385,10 @@ class RegexDSLTests: XCTestCase {
372
385
( " abc1def2 " , ( " abc1def2 " , " 1 " ) ) ,
373
386
matchType: ( Substring, Substring) . self, == )
374
387
{
375
- OneOrMore ( . reluctant) {
376
- One ( . word)
388
+ Regex {
389
+ OneOrMore ( . reluctant) {
390
+ One ( . word)
391
+ }
377
392
} . repetitionBehavior ( . possessive)
378
393
Capture ( . digit)
379
394
ZeroOrMore ( . any)
@@ -425,8 +440,9 @@ class RegexDSLTests: XCTestCase {
425
440
{
426
441
Regex {
427
442
Capture {
428
- OneOrMore ( " a " )
429
- . repetitionBehavior ( . eager)
443
+ Regex {
444
+ OneOrMore ( " a " )
445
+ } . repetitionBehavior ( . eager)
430
446
}
431
447
OneOrMore ( " a " )
432
448
} . repetitionBehavior ( . possessive)
@@ -438,8 +454,9 @@ class RegexDSLTests: XCTestCase {
438
454
{
439
455
Regex {
440
456
Capture {
441
- OneOrMore ( " a " )
442
- . repetitionBehavior ( . reluctant)
457
+ Regex {
458
+ OneOrMore ( " a " )
459
+ } . repetitionBehavior ( . reluctant)
443
460
}
444
461
OneOrMore ( " a " )
445
462
} . repetitionBehavior ( . possessive)
0 commit comments