mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
Fix #49048 - fix querybuilder unit tests
This commit is contained in:
parent
faeb4f48ba
commit
0ebdf8a29b
|
@ -437,31 +437,31 @@ suite('QueryBuilder', () => {
|
||||||
cases.forEach(testIncludesDataItem);
|
cases.forEach(testIncludesDataItem);
|
||||||
});
|
});
|
||||||
|
|
||||||
// test('includes with tilde', () => {
|
test('includes with tilde', () => {
|
||||||
// const userHome = TestEnvironmentService.userHome;
|
const userHome = TestEnvironmentService.userHome;
|
||||||
// const cases: [string, ISearchPathsResult][] = [
|
const cases: [string, ISearchPathsResult][] = [
|
||||||
// [
|
[
|
||||||
// '~/foo/bar',
|
'~/foo/bar',
|
||||||
// <ISearchPathsResult>{
|
<ISearchPathsResult>{
|
||||||
// searchPaths: [{ searchPath: getUri(userHome, '/foo/bar') }]
|
searchPaths: [{ searchPath: getUri(userHome, '/foo/bar') }]
|
||||||
// }
|
}
|
||||||
// ],
|
],
|
||||||
// [
|
[
|
||||||
// '~/foo/bar, a',
|
'~/foo/bar, a',
|
||||||
// <ISearchPathsResult>{
|
<ISearchPathsResult>{
|
||||||
// searchPaths: [{ searchPath: getUri(userHome, '/foo/bar') }],
|
searchPaths: [{ searchPath: getUri(userHome, '/foo/bar') }],
|
||||||
// pattern: patternsToIExpression(...globalGlob('a'))
|
pattern: patternsToIExpression(...globalGlob('a'))
|
||||||
// }
|
}
|
||||||
// ],
|
],
|
||||||
// [
|
[
|
||||||
// fixPath('/foo/~/bar'),
|
fixPath('/foo/~/bar'),
|
||||||
// <ISearchPathsResult>{
|
<ISearchPathsResult>{
|
||||||
// searchPaths: [{ searchPath: getUri('/foo/~/bar') }]
|
searchPaths: [{ searchPath: getUri('/foo/~/bar') }]
|
||||||
// }
|
}
|
||||||
// ],
|
],
|
||||||
// ];
|
];
|
||||||
// cases.forEach(testIncludesDataItem);
|
cases.forEach(testIncludesDataItem);
|
||||||
// });
|
});
|
||||||
|
|
||||||
test('relative includes w/single root folder', () => {
|
test('relative includes w/single root folder', () => {
|
||||||
const cases: [string, ISearchPathsResult][] = [
|
const cases: [string, ISearchPathsResult][] = [
|
||||||
|
@ -856,16 +856,11 @@ function getUri(...slashPathParts: string[]): uri {
|
||||||
}
|
}
|
||||||
|
|
||||||
function fixPath(...slashPathParts: string[]): string {
|
function fixPath(...slashPathParts: string[]): string {
|
||||||
const pathParts = arrays.flatten(slashPathParts.map(part => part.split('/')));
|
if (process.platform === 'win32' && slashPathParts.length && !slashPathParts[0].match(/^c:/i)) {
|
||||||
if (process.platform === 'win32') {
|
slashPathParts.unshift('c:');
|
||||||
if (slashPathParts.length === 1 && slashPathParts[0].match(/^c:/)) {
|
|
||||||
return slashPathParts[0];
|
|
||||||
} else {
|
|
||||||
return paths.join('c:', ...pathParts);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return paths.join(...pathParts);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return paths.join(...slashPathParts);
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeExpression(expression: IExpression): IExpression {
|
function normalizeExpression(expression: IExpression): IExpression {
|
||||||
|
|
Loading…
Reference in a new issue