@@ -373,17 +373,41 @@ it("line: 51 - matches ^(b+?|a){1,2}?c against 'bc'", () => {
373
373
expect ( match . matches [ 0 ] ) . toBe ( "bc" . substring ( 0 , 2 ) ) ;
374
374
expect ( match . matches [ 1 ] ) . toBe ( "bc" . substring ( 0 , 1 ) ) ;
375
375
} ) ;
376
- xit ( "line: 52 - issues with repeated capture groups" , ( ) => { } ) ;
377
- xit ( "line: 53 - issues with repeated capture groups" , ( ) => { } ) ;
378
- xit ( "line: 54 - issues with repeated capture groups" , ( ) => { } ) ;
379
- xit ( "line: 55 - issues with repeated capture groups" , ( ) => { } ) ;
376
+ it ( "line: 52 - matches ^(b+?|a){1,2}?c against 'bbc'" , ( ) => {
377
+ const match = exec ( "^(b+?|a){1,2}?c" , "bbc" , "s" ) ;
378
+ expect ( match . matches [ 0 ] ) . toBe ( "bbc" . substring ( 0 , 3 ) ) ;
379
+ expect ( match . matches [ 1 ] ) . toBe ( "bbc" . substring ( 1 , 2 ) ) ;
380
+ } ) ;
381
+ it ( "line: 53 - matches ^(b+?|a){1,2}?c against 'bbbc'" , ( ) => {
382
+ const match = exec ( "^(b+?|a){1,2}?c" , "bbbc" , "s" ) ;
383
+ expect ( match . matches [ 0 ] ) . toBe ( "bbbc" . substring ( 0 , 4 ) ) ;
384
+ expect ( match . matches [ 1 ] ) . toBe ( "bbbc" . substring ( 1 , 3 ) ) ;
385
+ } ) ;
386
+ it ( "line: 54 - matches ^(b+?|a){1,2}?c against 'bac'" , ( ) => {
387
+ const match = exec ( "^(b+?|a){1,2}?c" , "bac" , "s" ) ;
388
+ expect ( match . matches [ 0 ] ) . toBe ( "bac" . substring ( 0 , 3 ) ) ;
389
+ expect ( match . matches [ 1 ] ) . toBe ( "bac" . substring ( 1 , 2 ) ) ;
390
+ } ) ;
391
+ it ( "line: 55 - matches ^(b+?|a){1,2}?c against 'bbac'" , ( ) => {
392
+ const match = exec ( "^(b+?|a){1,2}?c" , "bbac" , "s" ) ;
393
+ expect ( match . matches [ 0 ] ) . toBe ( "bbac" . substring ( 0 , 4 ) ) ;
394
+ expect ( match . matches [ 1 ] ) . toBe ( "bbac" . substring ( 2 , 3 ) ) ;
395
+ } ) ;
380
396
it ( "line: 56 - matches ^(b+?|a){1,2}?c against 'aac'" , ( ) => {
381
397
const match = exec ( "^(b+?|a){1,2}?c" , "aac" , "s" ) ;
382
398
expect ( match . matches [ 0 ] ) . toBe ( "aac" . substring ( 0 , 3 ) ) ;
383
399
expect ( match . matches [ 1 ] ) . toBe ( "aac" . substring ( 1 , 2 ) ) ;
384
400
} ) ;
385
- xit ( "line: 57 - issues with repeated capture groups" , ( ) => { } ) ;
386
- xit ( "line: 58 - issues with repeated capture groups" , ( ) => { } ) ;
401
+ it ( "line: 57 - matches ^(b+?|a){1,2}?c against 'abbbbbbbbbbbc'" , ( ) => {
402
+ const match = exec ( "^(b+?|a){1,2}?c" , "abbbbbbbbbbbc" , "s" ) ;
403
+ expect ( match . matches [ 0 ] ) . toBe ( "abbbbbbbbbbbc" . substring ( 0 , 13 ) ) ;
404
+ expect ( match . matches [ 1 ] ) . toBe ( "abbbbbbbbbbbc" . substring ( 1 , 12 ) ) ;
405
+ } ) ;
406
+ it ( "line: 58 - matches ^(b+?|a){1,2}?c against 'bbbbbbbbbbbac'" , ( ) => {
407
+ const match = exec ( "^(b+?|a){1,2}?c" , "bbbbbbbbbbbac" , "s" ) ;
408
+ expect ( match . matches [ 0 ] ) . toBe ( "bbbbbbbbbbbac" . substring ( 0 , 13 ) ) ;
409
+ expect ( match . matches [ 1 ] ) . toBe ( "bbbbbbbbbbbac" . substring ( 11 , 12 ) ) ;
410
+ } ) ;
387
411
it ( "line: 59 - matches ^(b+?|a){1,2}?c against 'aaac'" , ( ) => {
388
412
expectNotMatch ( "^(b+?|a){1,2}?c" , [ "aaac" ] ) ;
389
413
} ) ;
@@ -400,12 +424,36 @@ it("line: 62 - matches ^(b+|a){1,2}c against 'bbc'", () => {
400
424
expect ( match . matches [ 0 ] ) . toBe ( "bbc" . substring ( 0 , 3 ) ) ;
401
425
expect ( match . matches [ 1 ] ) . toBe ( "bbc" . substring ( 0 , 2 ) ) ;
402
426
} ) ;
403
- xit ( "line: 63 - issues with repeated capture groups" , ( ) => { } ) ;
404
- xit ( "line: 64 - issues with repeated capture groups" , ( ) => { } ) ;
405
- xit ( "line: 65 - issues with repeated capture groups" , ( ) => { } ) ;
406
- xit ( "line: 66 - issues with repeated capture groups" , ( ) => { } ) ;
407
- xit ( "line: 67 - issues with repeated capture groups" , ( ) => { } ) ;
408
- xit ( "line: 68 - issues with repeated capture groups" , ( ) => { } ) ;
427
+ it ( "line: 63 - matches ^(b+|a){1,2}c against 'bbbc'" , ( ) => {
428
+ const match = exec ( "^(b+|a){1,2}c" , "bbbc" , "s" ) ;
429
+ expect ( match . matches [ 0 ] ) . toBe ( "bbbc" . substring ( 0 , 4 ) ) ;
430
+ expect ( match . matches [ 1 ] ) . toBe ( "bbbc" . substring ( 0 , 3 ) ) ;
431
+ } ) ;
432
+ it ( "line: 64 - matches ^(b+|a){1,2}c against 'bac'" , ( ) => {
433
+ const match = exec ( "^(b+|a){1,2}c" , "bac" , "s" ) ;
434
+ expect ( match . matches [ 0 ] ) . toBe ( "bac" . substring ( 0 , 3 ) ) ;
435
+ expect ( match . matches [ 1 ] ) . toBe ( "bac" . substring ( 1 , 2 ) ) ;
436
+ } ) ;
437
+ it ( "line: 65 - matches ^(b+|a){1,2}c against 'bbac'" , ( ) => {
438
+ const match = exec ( "^(b+|a){1,2}c" , "bbac" , "s" ) ;
439
+ expect ( match . matches [ 0 ] ) . toBe ( "bbac" . substring ( 0 , 4 ) ) ;
440
+ expect ( match . matches [ 1 ] ) . toBe ( "bbac" . substring ( 2 , 3 ) ) ;
441
+ } ) ;
442
+ it ( "line: 66 - matches ^(b+|a){1,2}c against 'aac'" , ( ) => {
443
+ const match = exec ( "^(b+|a){1,2}c" , "aac" , "s" ) ;
444
+ expect ( match . matches [ 0 ] ) . toBe ( "aac" . substring ( 0 , 3 ) ) ;
445
+ expect ( match . matches [ 1 ] ) . toBe ( "aac" . substring ( 1 , 2 ) ) ;
446
+ } ) ;
447
+ it ( "line: 67 - matches ^(b+|a){1,2}c against 'abbbbbbbbbbbc'" , ( ) => {
448
+ const match = exec ( "^(b+|a){1,2}c" , "abbbbbbbbbbbc" , "s" ) ;
449
+ expect ( match . matches [ 0 ] ) . toBe ( "abbbbbbbbbbbc" . substring ( 0 , 13 ) ) ;
450
+ expect ( match . matches [ 1 ] ) . toBe ( "abbbbbbbbbbbc" . substring ( 1 , 12 ) ) ;
451
+ } ) ;
452
+ it ( "line: 68 - matches ^(b+|a){1,2}c against 'bbbbbbbbbbbac'" , ( ) => {
453
+ const match = exec ( "^(b+|a){1,2}c" , "bbbbbbbbbbbac" , "s" ) ;
454
+ expect ( match . matches [ 0 ] ) . toBe ( "bbbbbbbbbbbac" . substring ( 0 , 13 ) ) ;
455
+ expect ( match . matches [ 1 ] ) . toBe ( "bbbbbbbbbbbac" . substring ( 11 , 12 ) ) ;
456
+ } ) ;
409
457
it ( "line: 69 - matches ^(b+|a){1,2}c against 'aaac'" , ( ) => {
410
458
expectNotMatch ( "^(b+|a){1,2}c" , [ "aaac" ] ) ;
411
459
} ) ;
@@ -417,8 +465,16 @@ it("line: 71 - matches ^(b+|a){1,2}?bc against 'bbc'", () => {
417
465
expect ( match . matches [ 0 ] ) . toBe ( "bbc" . substring ( 0 , 3 ) ) ;
418
466
expect ( match . matches [ 1 ] ) . toBe ( "bbc" . substring ( 0 , 1 ) ) ;
419
467
} ) ;
420
- xit ( "line: 72 - issues with repeated capture groups" , ( ) => { } ) ;
421
- xit ( "line: 73 - issues with repeated capture groups" , ( ) => { } ) ;
468
+ it ( "line: 72 - matches ^(b*|ba){1,2}?bc against 'babc'" , ( ) => {
469
+ const match = exec ( "^(b*|ba){1,2}?bc" , "babc" , "s" ) ;
470
+ expect ( match . matches [ 0 ] ) . toBe ( "babc" . substring ( 0 , 4 ) ) ;
471
+ expect ( match . matches [ 1 ] ) . toBe ( "babc" . substring ( 0 , 2 ) ) ;
472
+ } ) ;
473
+ it ( "line: 73 - matches ^(b*|ba){1,2}?bc against 'bbabc'" , ( ) => {
474
+ const match = exec ( "^(b*|ba){1,2}?bc" , "bbabc" , "s" ) ;
475
+ expect ( match . matches [ 0 ] ) . toBe ( "bbabc" . substring ( 0 , 5 ) ) ;
476
+ expect ( match . matches [ 1 ] ) . toBe ( "bbabc" . substring ( 1 , 3 ) ) ;
477
+ } ) ;
422
478
it ( "line: 74 - matches ^(b*|ba){1,2}?bc against 'bababc'" , ( ) => {
423
479
const match = exec ( "^(b*|ba){1,2}?bc" , "bababc" , "s" ) ;
424
480
expect ( match . matches [ 0 ] ) . toBe ( "bababc" . substring ( 0 , 6 ) ) ;
@@ -435,7 +491,11 @@ it("line: 77 - matches ^(ba|b*){1,2}?bc against 'babc'", () => {
435
491
expect ( match . matches [ 0 ] ) . toBe ( "babc" . substring ( 0 , 4 ) ) ;
436
492
expect ( match . matches [ 1 ] ) . toBe ( "babc" . substring ( 0 , 2 ) ) ;
437
493
} ) ;
438
- xit ( "line: 78 - issues with repeated capture groups" , ( ) => { } ) ;
494
+ it ( "line: 78 - matches ^(ba|b*){1,2}?bc against 'bbabc'" , ( ) => {
495
+ const match = exec ( "^(ba|b*){1,2}?bc" , "bbabc" , "s" ) ;
496
+ expect ( match . matches [ 0 ] ) . toBe ( "bbabc" . substring ( 0 , 5 ) ) ;
497
+ expect ( match . matches [ 1 ] ) . toBe ( "bbabc" . substring ( 1 , 3 ) ) ;
498
+ } ) ;
439
499
it ( "line: 79 - matches ^(ba|b*){1,2}?bc against 'bababc'" , ( ) => {
440
500
const match = exec ( "^(ba|b*){1,2}?bc" , "bababc" , "s" ) ;
441
501
expect ( match . matches [ 0 ] ) . toBe ( "bababc" . substring ( 0 , 6 ) ) ;
@@ -1199,8 +1259,32 @@ it("line: 261 - matches ^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-
1199
1259
"From abcd Mon Sep 01 12:33:02 1997" . substring ( 5 , 9 )
1200
1260
) ;
1201
1261
} ) ;
1202
- xit ( "line: 262 - issues with repeated capture groups" , ( ) => { } ) ;
1203
- xit ( "line: 263 - issues with repeated capture groups" , ( ) => { } ) ;
1262
+ it ( "line: 262 - matches ^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d against 'From abcd Mon Sep 01 12:33:02 1997'" , ( ) => {
1263
+ const match = exec (
1264
+ "^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d" ,
1265
+ "From abcd Mon Sep 01 12:33:02 1997" ,
1266
+ "s"
1267
+ ) ;
1268
+ expect ( match . matches [ 0 ] ) . toBe (
1269
+ "From abcd Mon Sep 01 12:33:02 1997" . substring ( 0 , 27 )
1270
+ ) ;
1271
+ expect ( match . matches [ 1 ] ) . toBe (
1272
+ "From abcd Mon Sep 01 12:33:02 1997" . substring ( 15 , 19 )
1273
+ ) ;
1274
+ } ) ;
1275
+ it ( "line: 263 - matches ^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d against 'From abcd Mon Sep 1 12:33:02 1997'" , ( ) => {
1276
+ const match = exec (
1277
+ "^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d" ,
1278
+ "From abcd Mon Sep 1 12:33:02 1997" ,
1279
+ "s"
1280
+ ) ;
1281
+ expect ( match . matches [ 0 ] ) . toBe (
1282
+ "From abcd Mon Sep 1 12:33:02 1997" . substring ( 0 , 27 )
1283
+ ) ;
1284
+ expect ( match . matches [ 1 ] ) . toBe (
1285
+ "From abcd Mon Sep 1 12:33:02 1997" . substring ( 15 , 20 )
1286
+ ) ;
1287
+ } ) ;
1204
1288
it ( "line: 264 - matches ^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d against 'From abcd Sep 01 12:33:02 1997'" , ( ) => {
1205
1289
expectNotMatch (
1206
1290
"^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d" ,
@@ -2089,8 +2173,15 @@ it("line: 1390 - matches ^[abc]{12} against 'abcabcabcabc'", () => {
2089
2173
const match = exec ( "^[abc]{12}" , "abcabcabcabc" , "s" ) ;
2090
2174
expect ( match . matches [ 0 ] ) . toBe ( "abcabcabcabc" . substring ( 0 , 12 ) ) ;
2091
2175
} ) ;
2092
- xit ( "line: 1391 - issues with repeated capture groups" , ( ) => { } ) ;
2093
- xit ( "line: 1392 - issues with repeated capture groups" , ( ) => { } ) ;
2176
+ it ( "line: 1391 - matches ^[a-c]{12} against 'abcabcabcabc'" , ( ) => {
2177
+ const match = exec ( "^[a-c]{12}" , "abcabcabcabc" , "s" ) ;
2178
+ expect ( match . matches [ 0 ] ) . toBe ( "abcabcabcabc" . substring ( 0 , 12 ) ) ;
2179
+ } ) ;
2180
+ it ( "line: 1392 - matches ^(a|b|c){12} against 'abcabcabcabc '" , ( ) => {
2181
+ const match = exec ( "^(a|b|c){12}" , "abcabcabcabc " , "s" ) ;
2182
+ expect ( match . matches [ 0 ] ) . toBe ( "abcabcabcabc " . substring ( 0 , 12 ) ) ;
2183
+ expect ( match . matches [ 1 ] ) . toBe ( "abcabcabcabc " . substring ( 11 , 12 ) ) ;
2184
+ } ) ;
2094
2185
it ( "line: 1393 - matches ^[abcdefghijklmnopqrstuvwxy0123456789] against 'n'" , ( ) => {
2095
2186
const match = exec ( "^[abcdefghijklmnopqrstuvwxy0123456789]" , "n" , "s" ) ;
2096
2187
expect ( match . matches [ 0 ] ) . toBe ( "n" . substring ( 0 , 1 ) ) ;
0 commit comments