mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 17:23:40 -05:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -18,6 +18,10 @@ import { onError } from 'vs/base/test/common/utils';
|
||||
|
||||
const ignore = () => { };
|
||||
|
||||
const mkdirp = (path: string, mode: number, callback: (error) => void) => {
|
||||
extfs.mkdirp(path, mode).done(() => callback(null), error => callback(error));
|
||||
};
|
||||
|
||||
suite('Extfs', () => {
|
||||
|
||||
test('mkdirp', function (done: () => void) {
|
||||
@@ -25,7 +29,7 @@ suite('Extfs', () => {
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'extfs', id);
|
||||
|
||||
extfs.mkdirp(newDir, 493, (error) => {
|
||||
mkdirp(newDir, 493, error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
@@ -51,7 +55,7 @@ suite('Extfs', () => {
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'extfs', id);
|
||||
|
||||
extfs.mkdirp(newDir, 493, (error) => {
|
||||
mkdirp(newDir, 493, error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
@@ -71,7 +75,7 @@ suite('Extfs', () => {
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'extfs', id);
|
||||
|
||||
extfs.mkdirp(newDir, 493, (error) => {
|
||||
mkdirp(newDir, 493, error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
@@ -97,7 +101,7 @@ suite('Extfs', () => {
|
||||
const targetDir = path.join(parentDir, id);
|
||||
const targetDir2 = path.join(parentDir, id2);
|
||||
|
||||
extfs.copy(sourceDir, targetDir, (error) => {
|
||||
extfs.copy(sourceDir, targetDir, error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
@@ -109,7 +113,7 @@ suite('Extfs', () => {
|
||||
assert.ok(fs.statSync(path.join(targetDir, 'examples')).isDirectory());
|
||||
assert.ok(fs.existsSync(path.join(targetDir, 'examples', 'small.jxs')));
|
||||
|
||||
extfs.mv(targetDir, targetDir2, (error) => {
|
||||
extfs.mv(targetDir, targetDir2, error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
@@ -122,7 +126,7 @@ suite('Extfs', () => {
|
||||
assert.ok(fs.statSync(path.join(targetDir2, 'examples')).isDirectory());
|
||||
assert.ok(fs.existsSync(path.join(targetDir2, 'examples', 'small.jxs')));
|
||||
|
||||
extfs.mv(path.join(targetDir2, 'index.html'), path.join(targetDir2, 'index_moved.html'), (error) => {
|
||||
extfs.mv(path.join(targetDir2, 'index.html'), path.join(targetDir2, 'index_moved.html'), error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
@@ -130,11 +134,11 @@ suite('Extfs', () => {
|
||||
assert.ok(!fs.existsSync(path.join(targetDir2, 'index.html')));
|
||||
assert.ok(fs.existsSync(path.join(targetDir2, 'index_moved.html')));
|
||||
|
||||
extfs.del(parentDir, os.tmpdir(), (error) => {
|
||||
extfs.del(parentDir, os.tmpdir(), error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
}, (error) => {
|
||||
}, error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
@@ -152,7 +156,7 @@ suite('Extfs', () => {
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'extfs', id, 'öäü');
|
||||
|
||||
extfs.mkdirp(newDir, 493, (error) => {
|
||||
mkdirp(newDir, 493, error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
@@ -176,14 +180,14 @@ suite('Extfs', () => {
|
||||
const newDir = path.join(parentDir, 'extfs', id);
|
||||
const testFile = path.join(newDir, 'flushed.txt');
|
||||
|
||||
extfs.mkdirp(newDir, 493, (error) => {
|
||||
mkdirp(newDir, 493, error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
|
||||
assert.ok(fs.existsSync(newDir));
|
||||
|
||||
extfs.writeFileAndFlush(testFile, 'Hello World', null, (error) => {
|
||||
extfs.writeFileAndFlush(testFile, 'Hello World', null, error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
@@ -192,7 +196,7 @@ suite('Extfs', () => {
|
||||
|
||||
const largeString = (new Array(100 * 1024)).join('Large String\n');
|
||||
|
||||
extfs.writeFileAndFlush(testFile, largeString, null, (error) => {
|
||||
extfs.writeFileAndFlush(testFile, largeString, null, error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
@@ -205,12 +209,37 @@ suite('Extfs', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('writeFileAndFlushSync', function (done: () => void) {
|
||||
const id = uuid.generateUuid();
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'extfs', id);
|
||||
const testFile = path.join(newDir, 'flushed.txt');
|
||||
|
||||
mkdirp(newDir, 493, error => {
|
||||
if (error) {
|
||||
return onError(error, done);
|
||||
}
|
||||
|
||||
assert.ok(fs.existsSync(newDir));
|
||||
|
||||
extfs.writeFileAndFlushSync(testFile, 'Hello World', null);
|
||||
assert.equal(fs.readFileSync(testFile), 'Hello World');
|
||||
|
||||
const largeString = (new Array(100 * 1024)).join('Large String\n');
|
||||
|
||||
extfs.writeFileAndFlushSync(testFile, largeString, null);
|
||||
assert.equal(fs.readFileSync(testFile), largeString);
|
||||
|
||||
extfs.del(parentDir, os.tmpdir(), done, ignore);
|
||||
});
|
||||
});
|
||||
|
||||
test('realcase', (done) => {
|
||||
const id = uuid.generateUuid();
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'extfs', id);
|
||||
|
||||
extfs.mkdirp(newDir, 493, (error) => {
|
||||
mkdirp(newDir, 493, error => {
|
||||
|
||||
// assume case insensitive file system
|
||||
if (process.platform === 'win32' || process.platform === 'darwin') {
|
||||
@@ -239,7 +268,7 @@ suite('Extfs', () => {
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'extfs', id);
|
||||
|
||||
extfs.mkdirp(newDir, 493, (error) => {
|
||||
mkdirp(newDir, 493, error => {
|
||||
|
||||
extfs.realpath(newDir, (error, realpath) => {
|
||||
assert.ok(realpath);
|
||||
@@ -255,7 +284,7 @@ suite('Extfs', () => {
|
||||
const parentDir = path.join(os.tmpdir(), 'vsctests', id);
|
||||
const newDir = path.join(parentDir, 'extfs', id);
|
||||
|
||||
extfs.mkdirp(newDir, 493, (error) => {
|
||||
mkdirp(newDir, 493, error => {
|
||||
let realpath: string;
|
||||
try {
|
||||
realpath = extfs.realpathSync(newDir);
|
||||
|
||||
Reference in New Issue
Block a user