mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 17:23:45 -05:00
Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 (#6381)
* Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 * disable strict null check
This commit is contained in:
28
src/vs/code/test/electron-main/nativeHelpers.test.ts
Normal file
28
src/vs/code/test/electron-main/nativeHelpers.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
|
||||
suite('Windows Native Helpers', () => {
|
||||
test('windows-mutex', async () => {
|
||||
if (!isWindows) {
|
||||
return;
|
||||
}
|
||||
|
||||
const mutex = await import('windows-mutex');
|
||||
assert.ok(mutex, 'Unable to load windows-mutex dependency.');
|
||||
assert.ok(typeof mutex.isActive === 'function', 'Unable to load windows-mutex dependency.');
|
||||
});
|
||||
|
||||
test('windows-foreground-love', async () => {
|
||||
if (!isWindows) {
|
||||
return;
|
||||
}
|
||||
|
||||
const foregroundLove = await import('windows-foreground-love');
|
||||
assert.ok(foregroundLove, 'Unable to load windows-foreground-love dependency.');
|
||||
});
|
||||
});
|
||||
@@ -4,10 +4,11 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as assert from 'assert';
|
||||
import { formatOptions, Option, addArg } from 'vs/platform/environment/node/argv';
|
||||
import { ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
|
||||
suite('formatOptions', () => {
|
||||
|
||||
function o(id: string, description: string): Option {
|
||||
function o(id: keyof ParsedArgs, description: string): Option {
|
||||
return {
|
||||
id, description, type: 'string'
|
||||
};
|
||||
@@ -16,30 +17,30 @@ suite('formatOptions', () => {
|
||||
test('Text should display small columns correctly', () => {
|
||||
assert.deepEqual(
|
||||
formatOptions([
|
||||
o('foo', 'bar')
|
||||
o('add', 'bar')
|
||||
], 80),
|
||||
[' --foo bar']
|
||||
[' --add bar']
|
||||
);
|
||||
assert.deepEqual(
|
||||
formatOptions([
|
||||
o('f', 'bar'),
|
||||
o('fo', 'ba'),
|
||||
o('foo', 'b')
|
||||
o('add', 'bar'),
|
||||
o('wait', 'ba'),
|
||||
o('trace', 'b')
|
||||
], 80),
|
||||
[
|
||||
' --f bar',
|
||||
' --fo ba',
|
||||
' --foo b'
|
||||
' --add bar',
|
||||
' --wait ba',
|
||||
' --trace b'
|
||||
]);
|
||||
});
|
||||
|
||||
test('Text should wrap', () => {
|
||||
assert.deepEqual(
|
||||
formatOptions([
|
||||
o('foo', (<any>'bar ').repeat(9))
|
||||
o('add', (<any>'bar ').repeat(9))
|
||||
], 40),
|
||||
[
|
||||
' --foo bar bar bar bar bar bar bar bar',
|
||||
' --add bar bar bar bar bar bar bar bar',
|
||||
' bar'
|
||||
]);
|
||||
});
|
||||
@@ -47,10 +48,10 @@ suite('formatOptions', () => {
|
||||
test('Text should revert to the condensed view when the terminal is too narrow', () => {
|
||||
assert.deepEqual(
|
||||
formatOptions([
|
||||
o('foo', (<any>'bar ').repeat(9))
|
||||
o('add', (<any>'bar ').repeat(9))
|
||||
], 30),
|
||||
[
|
||||
' --foo',
|
||||
' --add',
|
||||
' bar bar bar bar bar bar bar bar bar '
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user