提交 d5d8d98c 编写于 作者: D Daniel Imms

Add more terminal link test cases

Related #59052
上级 07951823
......@@ -62,7 +62,9 @@ suite('Workbench - TerminalLinkHandler', () => {
'c:/a/long/path',
'c:\\a\\long\\path',
'c:\\mixed/slash\\path',
'a/relative/path'
'a/relative/path',
'plain/path',
'plain\\path'
];
const supportedLinkFormats: LinkFormatInfo[] = [
......@@ -179,6 +181,19 @@ suite('Workbench - TerminalLinkHandler', () => {
stub.restore();
});
test('Windows - spaces', () => {
const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Windows, null, null, null, null);
linkHandler.initialCwd = 'C:\\base dir';
let stub = sinon.stub(path, 'join', function (arg1: string, arg2: string) {
return arg1 + '\\' + arg2;
});
assert.equal(linkHandler.preprocessPath('./src/file1'), 'C:\\base dir\\./src/file1');
assert.equal(linkHandler.preprocessPath('src\\file2'), 'C:\\base dir\\src\\file2');
assert.equal(linkHandler.preprocessPath('C:\\absolute\\path\\file3'), 'C:\\absolute\\path\\file3');
stub.restore();
});
test('Linux', () => {
const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null, null, null, null);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册