@@ -43,16 +43,18 @@ test('match only first', t => {
43
43
} ) ;
44
44
45
45
test ( 'match terminal link' , t => {
46
- t . regex ( '\u001B]8;k=v;https://example-a.com/?a_b=1&c=2#tit%20le\u0007click\u001B]8;;\u0007' , ansiRegex ( ) ) ;
47
- t . regex ( '\u001B]8;;mailto:no-replay@mail.com\u0007mail\u001B]8;;\u0007' , ansiRegex ( ) ) ;
48
- t . deepEqual ( '\u001B]8;k=v;https://example-a.com/?a_b=1&c=2#tit%20le\u0007click\u001B]8;;\u0007' . match ( ansiRegex ( ) ) , [
49
- '\u001B]8;k=v;https://example-a.com/?a_b=1&c=2#tit%20le\u0007' ,
50
- '\u001B]8;;\u0007' ,
51
- ] ) ;
52
- t . deepEqual ( '\u001B]8;;mailto:no-reply@mail.com\u0007mail-me\u001B]8;;\u0007' . match ( ansiRegex ( ) ) , [
53
- '\u001B]8;;mailto:no-reply@mail.com\u0007' ,
54
- '\u001B]8;;\u0007' ,
55
- ] ) ;
46
+ for ( const ST of [ '\u0007' , '\u001B\u005C' , '\u009C' ] ) {
47
+ t . regex ( `\u000B]8;k=v;https://example-a.com/?a_b=1&c=2#tit%20le${ ST } click\u001B]8;;${ ST } ` , ansiRegex ( ) ) ;
48
+ t . regex ( `\u001B]8;;mailto:no-replay@mail.com${ ST } mail\u001B]8;;${ ST } ` , ansiRegex ( ) ) ;
49
+ t . deepEqual ( `\u001B]8;k=v;https://example-a.com/?a_b=1&c=2#tit%20le${ ST } click\u001B]8;;${ ST } ` . match ( ansiRegex ( ) ) , [
50
+ `\u001B]8;k=v;https://example-a.com/?a_b=1&c=2#tit%20le${ ST } ` ,
51
+ `\u001B]8;;${ ST } ` ,
52
+ ] ) ;
53
+ t . deepEqual ( `\u001B]8;;mailto:no-reply@mail.com${ ST } mail-me\u001B]8;;${ ST } ` . match ( ansiRegex ( ) ) , [
54
+ `\u001B]8;;mailto:no-reply@mail.com${ ST } ` ,
55
+ `\u001B]8;;${ ST } ` ,
56
+ ] ) ;
57
+ }
56
58
} ) ;
57
59
58
60
test ( 'match "change icon name and window title" in string' , t => {
0 commit comments