Skip to content

Commit d5d8d98

Browse files
committed
Add more terminal link test cases
Related microsoft#59052
1 parent 0795182 commit d5d8d98

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ suite('Workbench - TerminalLinkHandler', () => {
6262
'c:/a/long/path',
6363
'c:\\a\\long\\path',
6464
'c:\\mixed/slash\\path',
65-
'a/relative/path'
65+
'a/relative/path',
66+
'plain/path',
67+
'plain\\path'
6668
];
6769

6870
const supportedLinkFormats: LinkFormatInfo[] = [
@@ -179,6 +181,19 @@ suite('Workbench - TerminalLinkHandler', () => {
179181

180182
stub.restore();
181183
});
184+
test('Windows - spaces', () => {
185+
const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Windows, null, null, null, null);
186+
linkHandler.initialCwd = 'C:\\base dir';
187+
188+
let stub = sinon.stub(path, 'join', function (arg1: string, arg2: string) {
189+
return arg1 + '\\' + arg2;
190+
});
191+
assert.equal(linkHandler.preprocessPath('./src/file1'), 'C:\\base dir\\./src/file1');
192+
assert.equal(linkHandler.preprocessPath('src\\file2'), 'C:\\base dir\\src\\file2');
193+
assert.equal(linkHandler.preprocessPath('C:\\absolute\\path\\file3'), 'C:\\absolute\\path\\file3');
194+
195+
stub.restore();
196+
});
182197

183198
test('Linux', () => {
184199
const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null, null, null, null);

0 commit comments

Comments
 (0)