diff --git a/src/vs/workbench/test/node/api/extHostWorkspace.test.ts b/src/vs/workbench/test/node/api/extHostWorkspace.test.ts index a6aee8f4070ef773a0ca711ba3193ec732dd576d..90636dba98469488608627e821ebb753464e8329 100644 --- a/src/vs/workbench/test/node/api/extHostWorkspace.test.ts +++ b/src/vs/workbench/test/node/api/extHostWorkspace.test.ts @@ -5,22 +5,31 @@ 'use strict'; +import { isWindows } from 'vs/base/common/platform'; import * as assert from 'assert'; import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; import { TestThreadService } from './testThreadService'; suite('ExtHostWorkspace', function () { + function fsPath(path: string): string { + if (isWindows) { + return path.replace(/\//g, '\\'); + } else { + return path; + } + } + test('asRelativePath', function () { const ws = new ExtHostWorkspace(new TestThreadService(), '/Coding/Applications/NewsWoWBot'); - assert.equal(ws.getRelativePath('/Coding/Applications/NewsWoWBot/bernd/das/brot'), 'bernd/das/brot'); + assert.equal(ws.getRelativePath('/Coding/Applications/NewsWoWBot/bernd/das/brot'), fsPath('bernd/das/brot')); assert.equal(ws.getRelativePath('/Apps/DartPubCache/hosted/pub.dartlang.org/convert-2.0.1/lib/src/hex.dart'), - '/Apps/DartPubCache/hosted/pub.dartlang.org/convert-2.0.1/lib/src/hex.dart'); + fsPath('/Apps/DartPubCache/hosted/pub.dartlang.org/convert-2.0.1/lib/src/hex.dart')); assert.equal(ws.getRelativePath(''), ''); - assert.equal(ws.getRelativePath('/foo/bar'), '/foo/bar'); + assert.equal(ws.getRelativePath('/foo/bar'), fsPath('/foo/bar')); }); test('asRelativePath, same paths, #11402', function () { @@ -28,7 +37,7 @@ suite('ExtHostWorkspace', function () { const input = '/home/aeschli/workspaces/samples/docker'; const ws = new ExtHostWorkspace(new TestThreadService(), root); - assert.equal(ws.getRelativePath(input), input); + assert.equal(ws.getRelativePath(input), fsPath(input)); const input2 = '/home/aeschli/workspaces/samples/docker/a.file'; assert.equal(ws.getRelativePath(input2), 'a.file');