提交 963b4a72 编写于 作者: D Daniel Imms

Fix tests, use alternate fix for \\?\% bug

上级 3235d3c9
...@@ -38,7 +38,7 @@ const excludedPathCharactersClause = '[^\\0\\s!$`&*()\\[\\]+\'":;\\\\]'; ...@@ -38,7 +38,7 @@ const excludedPathCharactersClause = '[^\\0\\s!$`&*()\\[\\]+\'":;\\\\]';
const unixLocalLinkClause = '((' + pathPrefix + '|(' + excludedPathCharactersClause + ')+)?(' + pathSeparatorClause + '(' + excludedPathCharactersClause + ')+)+)'; const unixLocalLinkClause = '((' + pathPrefix + '|(' + excludedPathCharactersClause + ')+)?(' + pathSeparatorClause + '(' + excludedPathCharactersClause + ')+)+)';
// Valid absolute formats: C:, \\?\C: and \\?\%VAR% // Valid absolute formats: C:, \\?\C: and \\?\%VAR%
const winDrivePrefix = '(?:\\\\\\\\\\?\\\\)?([a-zA-Z]:|%)'; const winDrivePrefix = '(?:\\\\\\\\\\?\\\\)?[a-zA-Z]:';
const winPathPrefix = '(' + winDrivePrefix + '|\\.\\.?|\\~)'; const winPathPrefix = '(' + winDrivePrefix + '|\\.\\.?|\\~)';
const winPathSeparatorClause = '(\\\\|\\/)'; const winPathSeparatorClause = '(\\\\|\\/)';
const winExcludedPathCharactersClause = '[^\\0<>\\?\\|\\/\\s!$`&*()\\[\\]+\'":;]'; const winExcludedPathCharactersClause = '[^\\0<>\\?\\|\\/\\s!$`&*()\\[\\]+\'":;]';
...@@ -465,7 +465,7 @@ export class TerminalLinkManager extends DisposableStore { ...@@ -465,7 +465,7 @@ export class TerminalLinkManager extends DisposableStore {
} else if (link.charAt(0) !== '/' && link.charAt(0) !== '~') { } else if (link.charAt(0) !== '/' && link.charAt(0) !== '~') {
// Resolve workspace path . | .. | <relative_path> -> <path>/. | <path>/.. | <path>/<relative_path> // Resolve workspace path . | .. | <relative_path> -> <path>/. | <path>/.. | <path>/<relative_path>
if (this._processManager.os === OperatingSystem.Windows) { if (this._processManager.os === OperatingSystem.Windows) {
if (!link.match('^' + winDrivePrefix)) { if (!link.match('^' + winDrivePrefix) && !link.startsWith('\\\\?\\')) {
if (!this._processCwd) { if (!this._processCwd) {
// Abort if no workspace is open // Abort if no workspace is open
return null; return null;
......
...@@ -113,10 +113,10 @@ suite('Workbench - TerminalLinkHandler', () => { ...@@ -113,10 +113,10 @@ suite('Workbench - TerminalLinkHandler', () => {
if (lineNo) { if (lineNo) {
const lineColumnInfo: LineColumnInfo = terminalLinkHandler.extractLineColumnInfo(link); const lineColumnInfo: LineColumnInfo = terminalLinkHandler.extractLineColumnInfo(link);
assert.equal(lineColumnInfo.lineNumber, lineNo); assert.equal(lineColumnInfo.lineNumber, lineNo, `For link ${link}, expected line number ${lineNo}, actual ${lineColumnInfo.lineNumber}`);
if (columnNo) { if (columnNo) {
assert.equal(lineColumnInfo.columnNumber, columnNo); assert.equal(lineColumnInfo.columnNumber, columnNo, `For link ${link}, expected column number ${columnNo}, actual ${lineColumnInfo.columnNumber}`);
} }
} }
} }
...@@ -190,10 +190,10 @@ suite('Workbench - TerminalLinkHandler', () => { ...@@ -190,10 +190,10 @@ suite('Workbench - TerminalLinkHandler', () => {
if (lineNo) { if (lineNo) {
const lineColumnInfo: LineColumnInfo = terminalLinkHandler.extractLineColumnInfo(link); const lineColumnInfo: LineColumnInfo = terminalLinkHandler.extractLineColumnInfo(link);
assert.equal(lineColumnInfo.lineNumber, lineNo); assert.equal(lineColumnInfo.lineNumber, lineNo, `For link ${link}, expected line number ${lineNo}, actual ${lineColumnInfo.lineNumber}`);
if (columnNo) { if (columnNo) {
assert.equal(lineColumnInfo.columnNumber, columnNo); assert.equal(lineColumnInfo.columnNumber, columnNo, `For link ${link}, expected column number ${columnNo}, actual ${lineColumnInfo.columnNumber}`);
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册