@@ -43,16 +43,19 @@ test('match only first', t => {
4343} ) ;
4444
4545test ( '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+ const STs = [ '\u0007' , '\u001B\u005C' , '\u009C' ]
47+ STs . forEach ( ST => {
48+ t . regex ( `\u000B]8;k=v;https://example-a.com/?a_b=1&c=2#tit%20le${ ST } click\u001B]8;;${ ST } ` , ansiRegex ( ) ) ;
49+ t . regex ( `\u001B]8;;mailto:no-replay@mail.com${ ST } mail\u001B]8;;${ ST } ` , ansiRegex ( ) ) ;
50+ t . deepEqual ( `\u001B]8;k=v;https://example-a.com/?a_b=1&c=2#tit%20le${ ST } click\u001B]8;;${ ST } ` . match ( ansiRegex ( ) ) , [
51+ `\u001B]8;k=v;https://example-a.com/?a_b=1&c=2#tit%20le${ ST } ` ,
52+ `\u001B]8;;${ ST } `
53+ ] ) ;
54+ t . deepEqual ( `\u001B]8;;mailto:no-reply@mail.com${ ST } mail-me\u001B]8;;${ ST } ` . match ( ansiRegex ( ) ) , [
55+ `\u001B]8;;mailto:no-reply@mail.com${ ST } ` ,
56+ `\u001B]8;;${ ST } `
57+ ] ) ;
58+ } )
5659} ) ;
5760
5861test ( 'match "change icon name and window title" in string' , t => {
0 commit comments