|
5 | 5 |
|
6 | 6 | 'use strict'; |
7 | 7 |
|
8 | | -import { isWindows } from 'vs/base/common/platform'; |
9 | 8 | import * as assert from 'assert'; |
10 | 9 | import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; |
11 | 10 | import { TestThreadService } from './testThreadService'; |
12 | 11 |
|
13 | 12 | suite('ExtHostWorkspace', function () { |
14 | 13 |
|
15 | | - function fsPath(path: string): string { |
16 | | - if (isWindows) { |
17 | | - return path.replace(/\//g, '\\'); |
18 | | - } else { |
19 | | - return path; |
20 | | - } |
21 | | - } |
22 | | - |
23 | 14 | test('asRelativePath', function () { |
24 | 15 |
|
25 | 16 | const ws = new ExtHostWorkspace(new TestThreadService(), '/Coding/Applications/NewsWoWBot'); |
26 | 17 |
|
27 | | - assert.equal(ws.getRelativePath('/Coding/Applications/NewsWoWBot/bernd/das/brot'), fsPath('bernd/das/brot')); |
| 18 | + assert.equal(ws.getRelativePath('/Coding/Applications/NewsWoWBot/bernd/das/brot'), 'bernd/das/brot'); |
28 | 19 | assert.equal(ws.getRelativePath('/Apps/DartPubCache/hosted/pub.dartlang.org/convert-2.0.1/lib/src/hex.dart'), |
29 | | - fsPath('/Apps/DartPubCache/hosted/pub.dartlang.org/convert-2.0.1/lib/src/hex.dart')); |
| 20 | + '/Apps/DartPubCache/hosted/pub.dartlang.org/convert-2.0.1/lib/src/hex.dart'); |
30 | 21 |
|
31 | 22 | assert.equal(ws.getRelativePath(''), ''); |
32 | | - assert.equal(ws.getRelativePath('/foo/bar'), fsPath('/foo/bar')); |
| 23 | + assert.equal(ws.getRelativePath('/foo/bar'), '/foo/bar'); |
33 | 24 | }); |
34 | 25 |
|
35 | 26 | test('asRelativePath, same paths, #11402', function () { |
36 | 27 | const root = '/home/aeschli/workspaces/samples/docker'; |
37 | 28 | const input = '/home/aeschli/workspaces/samples/docker'; |
38 | 29 | const ws = new ExtHostWorkspace(new TestThreadService(), root); |
39 | 30 |
|
40 | | - assert.equal(ws.getRelativePath(input), fsPath(input)); |
| 31 | + assert.equal(ws.getRelativePath(input), input); |
41 | 32 |
|
42 | 33 | const input2 = '/home/aeschli/workspaces/samples/docker/a.file'; |
43 | 34 | assert.equal(ws.getRelativePath(input2), 'a.file'); |
|
0 commit comments