Do not normalize paths (fixes #57475)

This commit is contained in:
Christof Marti committed 2018-09-05 16:11:02 +02:00
1 parent 639fe304f4
commit fa30debe48
2 files changed
+13 -1

No files matched your search

+1 -1
View File
@@ -343,7 +343,7 @@ function wrapRelativePattern(parsedPattern: ParsedStringPattern, arg2: string |
return null;
}
return parsedPattern(paths.normalize(arg2.pathToRelative(arg2.base, path)), basename);
return parsedPattern(arg2.pathToRelative(arg2.base, path), basename);
};
}
+12
View File
@@ -999,4 +999,16 @@ suite('Glob', () => {
test('pattern with "base" does not explode - #36081', function () {
assert.ok(glob.match({ 'base': true }, 'base'));
});
test('relative pattern - #57475', function () {
if (isWindows) {
let p: glob.IRelativePattern = { base: 'C:\\DNXConsoleApp\\foo', pattern: 'styles/style.css', pathToRelative: (from, to) => path.relative(from, to) };
assertGlobMatch(p, 'C:\\DNXConsoleApp\\foo\\styles\\style.css');
assertNoGlobMatch(p, 'C:\\DNXConsoleApp\\foo\\Program.cs');
} else {
let p: glob.IRelativePattern = { base: '/DNXConsoleApp/foo', pattern: 'styles/style.css', pathToRelative: (from, to) => path.relative(from, to) };
assertGlobMatch(p, '/DNXConsoleApp/foo/styles/style.css');
assertNoGlobMatch(p, '/DNXConsoleApp/foo/Program.cs');
}
});
});