File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,16 @@ test('match terminal link', t => {
5757 }
5858} ) ;
5959
60+ test ( 'match terminal link with plus in URL' , t => {
61+ for ( const ST of [ '\u0007' , '\u001B\u005C' , '\u009C' ] ) {
62+ const seqOpen = `\u001B]8;;https://www.example.com/?q=hello+world${ ST } ` ;
63+ const seqClose = `\u001B]8;;${ ST } ` ;
64+ const value = `${ seqOpen } hello${ seqClose } ` ;
65+ t . deepEqual ( value . match ( ansiRegex ( ) ) , [ seqOpen , seqClose ] ) ;
66+ t . is ( value . replace ( ansiRegex ( ) , '' ) , 'hello' ) ;
67+ }
68+ } ) ;
69+
6070test ( 'match "change icon name and window title" in string' , t => {
6171 t . is ( '\u001B]0;sg@tota:~/git/\u0007\u001B[01;32m[sg@tota\u001B[01;37m misc-tests\u001B[01;32m]$' . match ( ansiRegex ( ) ) [ 0 ] , '\u001B]0;sg@tota:~/git/\u0007' ) ;
6272} ) ;
You can’t perform that action at this time.
0 commit comments