4
4
import { RegExp , Match } from ".." ;
5
5
import { expectMatch , expectNotMatch , exec } from "../__tests__/utils" ;
6
6
7
- xit ( "line: 1 - requires triage" , ( ) => { } ) ;
7
+ it ( "line: 1 - matches the quick brown fox against 'the quick brown fox'" , ( ) => {
8
+ const match = exec ( "the quick brown fox" , "the quick brown fox" , "" ) ;
9
+ expect ( match . matches [ 0 ] ) . toBe ( "the quick brown fox" . substring ( 0 , 19 ) ) ;
10
+ } ) ;
8
11
it ( "line: 2 - matches the quick brown fox against 'The quick brown FOX'" , ( ) => {
9
12
expectNotMatch ( "the quick brown fox" , [ "The quick brown FOX" ] ) ;
10
13
} ) ;
@@ -514,7 +517,10 @@ it("line: 111 - matches ^[^]cde] against 'dthing'", () => {
514
517
it ( "line: 112 - matches ^[^]cde] against 'ething'" , ( ) => {
515
518
expectNotMatch ( "^[^]cde]" , [ "ething" ] ) ;
516
519
} ) ;
517
- xit ( "line: 113 - requires triage" , ( ) => { } ) ;
520
+ it ( "line: 113 - matches ^\\� against '�'" , ( ) => {
521
+ const match = exec ( "^\\�" , "�" , "" ) ;
522
+ expect ( match . matches [ 0 ] ) . toBe ( "�" . substring ( 0 , 1 ) ) ;
523
+ } ) ;
518
524
it ( "line: 114 - matches ^� against '�'" , ( ) => {
519
525
const match = exec ( "^�" , "�" , "" ) ;
520
526
expect ( match . matches [ 0 ] ) . toBe ( "�" . substring ( 0 , 1 ) ) ;
@@ -1260,7 +1266,7 @@ it("line: 1154 - matches ^abc$ against 'abc'", () => {
1260
1266
xit ( "line: 1155 - test cases with CRs not supported yet!" , ( ) => { } ) ;
1261
1267
xit ( "line: 1156 - test cases with CRs not supported yet!" , ( ) => { } ) ;
1262
1268
xit ( "line: 1157 - test cases with CRs not supported yet!" , ( ) => { } ) ;
1263
- xit ( "line: 1158 - bug: g should not throw unsupported char class " , ( ) => { } ) ;
1269
+ xit ( "line: 1158 - requires triage " , ( ) => { } ) ;
1264
1270
xit ( "line: 1159 - test cases with CRs not supported yet!" , ( ) => { } ) ;
1265
1271
xit ( "line: 1160 - test cases with CRs not supported yet!" , ( ) => { } ) ;
1266
1272
xit ( "line: 1161 - test cases with CRs not supported yet!" , ( ) => { } ) ;
@@ -1305,8 +1311,13 @@ it("line: 1178 - matches \\\x5c against '\\'", () => {
1305
1311
const match = exec ( "\\\x5c" , "\\" , "" ) ;
1306
1312
expect ( match . matches [ 0 ] ) . toBe ( "\\" . substring ( 0 , 1 ) ) ;
1307
1313
} ) ;
1308
- xit ( "line: 1179 - bug: g should not throw unsupported char class" , ( ) => { } ) ;
1309
- xit ( "line: 1180 - bug: g should not throw unsupported char class" , ( ) => { } ) ;
1314
+ it ( "line: 1179 - matches \\\x20Z against 'the Zoo'" , ( ) => {
1315
+ const match = exec ( "\\\x20Z" , "the Zoo" , "" ) ;
1316
+ expect ( match . matches [ 0 ] ) . toBe ( "the Zoo" . substring ( 3 , 5 ) ) ;
1317
+ } ) ;
1318
+ it ( "line: 1180 - matches \\\x20Z against 'Zulu'" , ( ) => {
1319
+ expectNotMatch ( "\\\x20Z" , [ "Zulu" ] ) ;
1320
+ } ) ;
1310
1321
xit ( "line: 1181 - back references are not supported" , ( ) => { } ) ;
1311
1322
xit ( "line: 1182 - back references are not supported" , ( ) => { } ) ;
1312
1323
xit ( "line: 1183 - back references are not supported" , ( ) => { } ) ;
@@ -1355,7 +1366,10 @@ xit("line: 1218 - back references are not supported", () => {});
1355
1366
xit ( "line: 1219 - back references are not supported" , ( ) => { } ) ;
1356
1367
xit ( "line: 1220 - back references are not supported" , ( ) => { } ) ;
1357
1368
xit ( "line: 1221 - non capturing groups not supported" , ( ) => { } ) ;
1358
- xit ( "line: 1223 - bug: g should not throw unsupported char class" , ( ) => { } ) ;
1369
+ it ( "line: 1223 - matches ab\\gdef against 'abgdef'" , ( ) => {
1370
+ const match = exec ( "ab\\gdef" , "abgdef" , "" ) ;
1371
+ expect ( match . matches [ 0 ] ) . toBe ( "abgdef" . substring ( 0 , 6 ) ) ;
1372
+ } ) ;
1359
1373
xit ( "line: 1224 - requires triage" , ( ) => { } ) ;
1360
1374
xit ( "line: 1225 - lazy quantifiers are not supported" , ( ) => { } ) ;
1361
1375
xit ( "line: 1226 - back references are not supported" , ( ) => { } ) ;
@@ -1364,13 +1378,15 @@ xit("line: 1228 - back references are not supported", () => {});
1364
1378
xit ( "line: 1229 - back references are not supported" , ( ) => { } ) ;
1365
1379
xit ( "line: 1230 - back references are not supported" , ( ) => { } ) ;
1366
1380
xit ( "line: 1231 - test cases with CRs not supported yet!" , ( ) => { } ) ;
1367
- xit ( "line: 1232 - bug: g should not throw unsupported char class" , ( ) => { } ) ;
1368
- xit ( "line: 1233 - bug: g should not throw unsupported char class" , ( ) => { } ) ;
1369
- xit ( "line: 1234 - bug: g should not throw unsupported char class" , ( ) => { } ) ;
1370
- xit ( "line: 1235 - bug: g should not throw unsupported char class" , ( ) => { } ) ;
1371
- xit ( "line: 1236 - bug: g should not throw unsupported char class" , ( ) => { } ) ;
1381
+ xit ( "line: 1232 - requires triage" , ( ) => { } ) ;
1382
+ xit ( "line: 1233 - requires triage" , ( ) => { } ) ;
1383
+ xit ( "line: 1234 - requires triage" , ( ) => { } ) ;
1384
+ xit ( "line: 1235 - requires triage" , ( ) => { } ) ;
1385
+ it ( "line: 1236 - matches ^([^a])([^\\\b])([^c]*)([^d]{3,4}) against 'anything'" , ( ) => {
1386
+ expectNotMatch ( "^([^a])([^\\\b])([^c]*)([^d]{3,4})" , [ "anything" ] ) ;
1387
+ } ) ;
1372
1388
xit ( "line: 1237 - requires triage" , ( ) => { } ) ;
1373
- xit ( "line: 1238 - bug: g should not throw unsupported char class " , ( ) => { } ) ;
1389
+ xit ( "line: 1238 - requires triage " , ( ) => { } ) ;
1374
1390
xit ( "line: 1239 - requires triage" , ( ) => { } ) ;
1375
1391
it ( "line: 1240 - matches [^a] against 'Abc'" , ( ) => {
1376
1392
const match = exec ( "[^a]" , "Abc" , "" ) ;
@@ -1418,9 +1434,17 @@ it("line: 1251 - matches [^k]{2,3}$ against 'akb'", () => {
1418
1434
it ( "line: 1252 - matches [^k]{2,3}$ against 'akk '" , ( ) => {
1419
1435
expectNotMatch ( "[^k]{2,3}$" , [ "akk " ] ) ;
1420
1436
} ) ;
1421
- xit ( "line: 1253 - bug: g should not throw unsupported char class" , ( ) => { } ) ;
1422
- xit ( "line: 1254 - bug: g should not throw unsupported char class" , ( ) => { } ) ;
1423
- xit ( "line: 1255 - bug: g should not throw unsupported char class" , ( ) => { } ) ;
1437
+ it ( "line: 1253 - matches ^\\d{8,}\\@.+[^k]$ against '[email protected] '" , ( ) => {
1438
+ const match = exec ( "^\\d{8,}\\@.+[^k]$" , "[email protected] " , "" ) ;
1439
+ expect ( match . matches [ 0 ] ) . toBe ( "[email protected] " . substring ( 0 , 16 ) ) ;
1440
+ } ) ;
1441
+ it ( "line: 1254 - matches ^\\d{8,}\\@.+[^k]$ against '[email protected] '" , ( ) => {
1442
+ const match = exec ( "^\\d{8,}\\@.+[^k]$" , "[email protected] " , "" ) ;
1443
+ expect ( match . matches [ 0 ] ) . toBe ( "[email protected] " . substring ( 0 , 15 ) ) ;
1444
+ } ) ;
1445
+ it ( "line: 1255 - matches ^\\d{8,}\\@.+[^k]$ against '[email protected] '" , ( ) => {
1446
+ expectNotMatch ( "^\\d{8,}\\@.+[^k]$" , [ "[email protected] " ] ) ;
1447
+ } ) ;
1424
1448
it ( "line: 1256 - matches ^\\d{8,}\\@.+[^k]$ against '[email protected] '" , ( ) => {
1425
1449
expectNotMatch ( "^\\d{8,}\\@.+[^k]$" , [ "[email protected] " ] ) ;
1426
1450
} ) ;
@@ -1483,7 +1507,7 @@ xit("line: 1276 - non capturing groups not supported", () => {});
1483
1507
xit ( "line: 1277 - non capturing groups not supported" , ( ) => { } ) ;
1484
1508
xit ( "line: 1278 - non capturing groups not supported" , ( ) => { } ) ;
1485
1509
xit ( "line: 1279 - non capturing groups not supported" , ( ) => { } ) ;
1486
- xit ( "line: 1280 - bug: g should not throw unsupported char class " , ( ) => { } ) ;
1510
+ xit ( "line: 1280 - requires triage " , ( ) => { } ) ;
1487
1511
it ( "line: 1281 - matches foo(.*)bar against 'The food is under the bar in the barn.'" , ( ) => {
1488
1512
const match = exec (
1489
1513
"foo(.*)bar" ,
@@ -1519,7 +1543,7 @@ it("line: 1287 - matches (.*)(\\d+)$ against 'I have 2 numbers: 53147'", () => {
1519
1543
expect ( match . matches [ 2 ] ) . toBe ( "I have 2 numbers: 53147" . substring ( 22 , 23 ) ) ;
1520
1544
} ) ;
1521
1545
xit ( "line: 1288 - lazy quantifiers are not supported" , ( ) => { } ) ;
1522
- xit ( "line: 1289 - bug: g should not throw unsupported char class " , ( ) => { } ) ;
1546
+ xit ( "line: 1289 - requires triage " , ( ) => { } ) ;
1523
1547
it ( "line: 1290 - matches (.*\\D)(\\d+)$ against 'I have 2 numbers: 53147'" , ( ) => {
1524
1548
const match = exec ( "(.*\\D)(\\d+)$" , "I have 2 numbers: 53147" , "" ) ;
1525
1549
expect ( match . matches [ 0 ] ) . toBe ( "I have 2 numbers: 53147" . substring ( 0 , 23 ) ) ;
0 commit comments