From 4eff097665118df0b635e395e0507778d2e0f2bc Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 30 Nov 2016 14:01:46 -0800 Subject: [PATCH] :lipstick: --- .../backup/test/backupFileService.test.ts | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/vs/workbench/services/backup/test/backupFileService.test.ts b/src/vs/workbench/services/backup/test/backupFileService.test.ts index 47048bb0d07..ccd7429141c 100644 --- a/src/vs/workbench/services/backup/test/backupFileService.test.ts +++ b/src/vs/workbench/services/backup/test/backupFileService.test.ts @@ -45,20 +45,20 @@ class TestBackupFileService extends BackupFileService { } } -suite('BackupFileService', () => { - const parentDir = path.join(os.tmpdir(), 'vsctests', 'service'); - const backupHome = path.join(parentDir, 'Backups'); - const workspacesJsonPath = path.join(backupHome, 'workspaces.json'); - - const workspaceResource = Uri.file(platform.isWindows ? 'c:\\workspace' : '/workspace'); - const workspaceBackupPath = path.join(backupHome, crypto.createHash('md5').update(workspaceResource.fsPath).digest('hex')); - const fooFile = Uri.file(platform.isWindows ? 'c:\\foo' : '/foo'); - const barFile = Uri.file(platform.isWindows ? 'c:\\bar' : '/bar'); - const untitledFile = Uri.from({ scheme: 'untitled', path: 'Untitled-1' }); - const fooBackupPath = path.join(workspaceBackupPath, 'file', crypto.createHash('md5').update(fooFile.fsPath).digest('hex')); - const barBackupPath = path.join(workspaceBackupPath, 'file', crypto.createHash('md5').update(barFile.fsPath).digest('hex')); - const untitledBackupPath = path.join(workspaceBackupPath, 'untitled', crypto.createHash('md5').update(untitledFile.fsPath).digest('hex')); +const parentDir = path.join(os.tmpdir(), 'vsctests', 'service'); +const backupHome = path.join(parentDir, 'Backups'); +const workspacesJsonPath = path.join(backupHome, 'workspaces.json'); + +const workspaceResource = Uri.file(platform.isWindows ? 'c:\\workspace' : '/workspace'); +const workspaceBackupPath = path.join(backupHome, crypto.createHash('md5').update(workspaceResource.fsPath).digest('hex')); +const fooFile = Uri.file(platform.isWindows ? 'c:\\foo' : '/foo'); +const barFile = Uri.file(platform.isWindows ? 'c:\\bar' : '/bar'); +const untitledFile = Uri.from({ scheme: 'untitled', path: 'Untitled-1' }); +const fooBackupPath = path.join(workspaceBackupPath, 'file', crypto.createHash('md5').update(fooFile.fsPath).digest('hex')); +const barBackupPath = path.join(workspaceBackupPath, 'file', crypto.createHash('md5').update(barFile.fsPath).digest('hex')); +const untitledBackupPath = path.join(workspaceBackupPath, 'untitled', crypto.createHash('md5').update(untitledFile.fsPath).digest('hex')); +suite('BackupFileService', () => { let service: TestBackupFileService; setup(done => { @@ -232,8 +232,10 @@ suite('BackupFileService', () => { }; assert.equal(service.parseBackupContent(rawTextContent), 'content'); }); +}); - test('BackupFilesModel - simple', () => { +suite('BackupFilesModel', () => { + test('simple', () => { const model = new BackupFilesModel(); const resource1 = Uri.file('test.html'); @@ -280,7 +282,7 @@ suite('BackupFileService', () => { assert.equal(model.has(resource4), true); }); - test('BackupFilesModel - resolve', (done) => { + test('resolve', (done) => { pfs.mkdirp(path.dirname(fooBackupPath)).then(() => { fs.writeFileSync(fooBackupPath, 'foo'); @@ -294,7 +296,7 @@ suite('BackupFileService', () => { }); }); - test('BackupFilesModel - get', () => { + test('get', () => { const model = new BackupFilesModel(); assert.deepEqual(model.get(), []); -- GitLab