Skip to content

Commit ff7c5f6

Browse files
committed
Add test for #57
Closes #57
1 parent 72bc570 commit ff7c5f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
6070
test('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
});

0 commit comments

Comments
 (0)