chore(vscode): update to 1.53.2
These conflicts will be resolved in the following commits. We do it this way so that PR review is possible.
This commit is contained in:
@@ -4,70 +4,52 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as os from 'os';
|
||||
import * as path from 'vs/base/common/path';
|
||||
import * as uuid from 'vs/base/common/uuid';
|
||||
import * as pfs from 'vs/base/node/pfs';
|
||||
import { tmpdir } from 'os';
|
||||
import { mkdirp, rimraf } from 'vs/base/node/pfs';
|
||||
import { realcaseSync, realpath, realpathSync } from 'vs/base/node/extpath';
|
||||
import { flakySuite, getRandomTestPath } from 'vs/base/test/node/testUtils';
|
||||
|
||||
suite('Extpath', () => {
|
||||
flakySuite('Extpath', () => {
|
||||
let testDir: string;
|
||||
|
||||
setup(() => {
|
||||
testDir = getRandomTestPath(tmpdir(), 'vsctests', 'extpath');
|
||||
|
||||
return mkdirp(testDir, 493);
|
||||
});
|
||||
|
||||
teardown(() => {
|
||||
return rimraf(testDir);
|
||||
});
|
||||
|
||||
test('realcase', async () => {
|
||||
const id = uuid.generateUuid();
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'extpath', id);
|
||||
|
||||
await pfs.mkdirp(newDir, 493);
|
||||
|
||||
// assume case insensitive file system
|
||||
if (process.platform === 'win32' || process.platform === 'darwin') {
|
||||
const upper = newDir.toUpperCase();
|
||||
const upper = testDir.toUpperCase();
|
||||
const real = realcaseSync(upper);
|
||||
|
||||
if (real) { // can be null in case of permission errors
|
||||
assert.notEqual(real, upper);
|
||||
assert.equal(real.toUpperCase(), upper);
|
||||
assert.equal(real, newDir);
|
||||
assert.notStrictEqual(real, upper);
|
||||
assert.strictEqual(real.toUpperCase(), upper);
|
||||
assert.strictEqual(real, testDir);
|
||||
}
|
||||
}
|
||||
|
||||
// linux, unix, etc. -> assume case sensitive file system
|
||||
else {
|
||||
const real = realcaseSync(newDir);
|
||||
assert.equal(real, newDir);
|
||||
const real = realcaseSync(testDir);
|
||||
assert.strictEqual(real, testDir);
|
||||
}
|
||||
|
||||
await pfs.rimraf(parentDir, pfs.RimRafMode.MOVE);
|
||||
});
|
||||
|
||||
test('realpath', async () => {
|
||||
const id = uuid.generateUuid();
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'extpath', id);
|
||||
|
||||
await pfs.mkdirp(newDir, 493);
|
||||
|
||||
const realpathVal = await realpath(newDir);
|
||||
const realpathVal = await realpath(testDir);
|
||||
assert.ok(realpathVal);
|
||||
|
||||
await pfs.rimraf(parentDir, pfs.RimRafMode.MOVE);
|
||||
});
|
||||
|
||||
test('realpathSync', async () => {
|
||||
const id = uuid.generateUuid();
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'extpath', id);
|
||||
|
||||
await pfs.mkdirp(newDir, 493);
|
||||
|
||||
let realpath!: string;
|
||||
try {
|
||||
realpath = realpathSync(newDir);
|
||||
} catch (error) {
|
||||
assert.ok(!error);
|
||||
}
|
||||
assert.ok(realpath!);
|
||||
|
||||
await pfs.rimraf(parentDir, pfs.RimRafMode.MOVE);
|
||||
test('realpathSync', () => {
|
||||
const realpath = realpathSync(testDir);
|
||||
assert.ok(realpath);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user