44import { RegExp , Match } from ".." ;
55import { expectMatch , expectNotMatch , exec } from "../__tests__/utils" ;
66
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+ } ) ;
811it ( "line: 2 - matches the quick brown fox against 'The quick brown FOX'" , ( ) => {
912 expectNotMatch ( "the quick brown fox" , [ "The quick brown FOX" ] ) ;
1013} ) ;
@@ -514,7 +517,10 @@ it("line: 111 - matches ^[^]cde] against 'dthing'", () => {
514517it ( "line: 112 - matches ^[^]cde] against 'ething'" , ( ) => {
515518 expectNotMatch ( "^[^]cde]" , [ "ething" ] ) ;
516519} ) ;
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+ } ) ;
518524it ( "line: 114 - matches ^� against '�'" , ( ) => {
519525 const match = exec ( "^�" , "�" , "" ) ;
520526 expect ( match . matches [ 0 ] ) . toBe ( "�" . substring ( 0 , 1 ) ) ;
@@ -1260,7 +1266,7 @@ it("line: 1154 - matches ^abc$ against 'abc'", () => {
12601266xit ( "line: 1155 - test cases with CRs not supported yet!" , ( ) => { } ) ;
12611267xit ( "line: 1156 - test cases with CRs not supported yet!" , ( ) => { } ) ;
12621268xit ( "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 " , ( ) => { } ) ;
12641270xit ( "line: 1159 - test cases with CRs not supported yet!" , ( ) => { } ) ;
12651271xit ( "line: 1160 - test cases with CRs not supported yet!" , ( ) => { } ) ;
12661272xit ( "line: 1161 - test cases with CRs not supported yet!" , ( ) => { } ) ;
@@ -1305,8 +1311,13 @@ it("line: 1178 - matches \\\x5c against '\\'", () => {
13051311 const match = exec ( "\\\x5c" , "\\" , "" ) ;
13061312 expect ( match . matches [ 0 ] ) . toBe ( "\\" . substring ( 0 , 1 ) ) ;
13071313} ) ;
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+ } ) ;
13101321xit ( "line: 1181 - back references are not supported" , ( ) => { } ) ;
13111322xit ( "line: 1182 - back references are not supported" , ( ) => { } ) ;
13121323xit ( "line: 1183 - back references are not supported" , ( ) => { } ) ;
@@ -1355,7 +1366,10 @@ xit("line: 1218 - back references are not supported", () => {});
13551366xit ( "line: 1219 - back references are not supported" , ( ) => { } ) ;
13561367xit ( "line: 1220 - back references are not supported" , ( ) => { } ) ;
13571368xit ( "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+ } ) ;
13591373xit ( "line: 1224 - requires triage" , ( ) => { } ) ;
13601374xit ( "line: 1225 - lazy quantifiers are not supported" , ( ) => { } ) ;
13611375xit ( "line: 1226 - back references are not supported" , ( ) => { } ) ;
@@ -1364,13 +1378,15 @@ xit("line: 1228 - back references are not supported", () => {});
13641378xit ( "line: 1229 - back references are not supported" , ( ) => { } ) ;
13651379xit ( "line: 1230 - back references are not supported" , ( ) => { } ) ;
13661380xit ( "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+ } ) ;
13721388xit ( "line: 1237 - requires triage" , ( ) => { } ) ;
1373- xit ( "line: 1238 - bug: g should not throw unsupported char class " , ( ) => { } ) ;
1389+ xit ( "line: 1238 - requires triage " , ( ) => { } ) ;
13741390xit ( "line: 1239 - requires triage" , ( ) => { } ) ;
13751391it ( "line: 1240 - matches [^a] against 'Abc'" , ( ) => {
13761392 const match = exec ( "[^a]" , "Abc" , "" ) ;
@@ -1418,9 +1434,17 @@ it("line: 1251 - matches [^k]{2,3}$ against 'akb'", () => {
14181434it ( "line: 1252 - matches [^k]{2,3}$ against 'akk '" , ( ) => {
14191435 expectNotMatch ( "[^k]{2,3}$" , [ "akk " ] ) ;
14201436} ) ;
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 '12345678@a.b.c.d'" , ( ) => {
1438+ const match = exec ( "^\\d{8,}\\@.+[^k]$" , "12345678@a.b.c.d" , "" ) ;
1439+ expect ( match . matches [ 0 ] ) . toBe ( "12345678@a.b.c.d" . substring ( 0 , 16 ) ) ;
1440+ } ) ;
1441+ it ( "line: 1254 - matches ^\\d{8,}\\@.+[^k]$ against '123456789@x.y.z'" , ( ) => {
1442+ const match = exec ( "^\\d{8,}\\@.+[^k]$" , "123456789@x.y.z" , "" ) ;
1443+ expect ( match . matches [ 0 ] ) . toBe ( "123456789@x.y.z" . substring ( 0 , 15 ) ) ;
1444+ } ) ;
1445+ it ( "line: 1255 - matches ^\\d{8,}\\@.+[^k]$ against '12345678@x.y.uk'" , ( ) => {
1446+ expectNotMatch ( "^\\d{8,}\\@.+[^k]$" , [ "12345678@x.y.uk" ] ) ;
1447+ } ) ;
14241448it ( "line: 1256 - matches ^\\d{8,}\\@.+[^k]$ against '1234567@a.b.c.d '" , ( ) => {
14251449 expectNotMatch ( "^\\d{8,}\\@.+[^k]$" , [ "1234567@a.b.c.d " ] ) ;
14261450} ) ;
@@ -1483,7 +1507,7 @@ xit("line: 1276 - non capturing groups not supported", () => {});
14831507xit ( "line: 1277 - non capturing groups not supported" , ( ) => { } ) ;
14841508xit ( "line: 1278 - non capturing groups not supported" , ( ) => { } ) ;
14851509xit ( "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 " , ( ) => { } ) ;
14871511it ( "line: 1281 - matches foo(.*)bar against 'The food is under the bar in the barn.'" , ( ) => {
14881512 const match = exec (
14891513 "foo(.*)bar" ,
@@ -1519,7 +1543,7 @@ it("line: 1287 - matches (.*)(\\d+)$ against 'I have 2 numbers: 53147'", () => {
15191543 expect ( match . matches [ 2 ] ) . toBe ( "I have 2 numbers: 53147" . substring ( 22 , 23 ) ) ;
15201544} ) ;
15211545xit ( "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 " , ( ) => { } ) ;
15231547it ( "line: 1290 - matches (.*\\D)(\\d+)$ against 'I have 2 numbers: 53147'" , ( ) => {
15241548 const match = exec ( "(.*\\D)(\\d+)$" , "I have 2 numbers: 53147" , "" ) ;
15251549 expect ( match . matches [ 0 ] ) . toBe ( "I have 2 numbers: 53147" . substring ( 0 , 23 ) ) ;
0 commit comments