chore(vscode): update to 1.54.2
This commit is contained in:
@@ -30,7 +30,7 @@ suite('dom', () => {
|
||||
assert(element.classList.contains('far'));
|
||||
assert(!element.classList.contains('boo'));
|
||||
assert(element.classList.contains('foobar'));
|
||||
assert.equal(element.className, 'foobar far');
|
||||
assert.strictEqual(element.className, 'foobar far');
|
||||
|
||||
element = document.createElement('div');
|
||||
element.className = 'foobar boo far';
|
||||
@@ -39,19 +39,19 @@ suite('dom', () => {
|
||||
assert(!element.classList.contains('far'));
|
||||
assert(element.classList.contains('boo'));
|
||||
assert(element.classList.contains('foobar'));
|
||||
assert.equal(element.className, 'foobar boo');
|
||||
assert.strictEqual(element.className, 'foobar boo');
|
||||
|
||||
element.classList.remove('boo');
|
||||
assert(!element.classList.contains('far'));
|
||||
assert(!element.classList.contains('boo'));
|
||||
assert(element.classList.contains('foobar'));
|
||||
assert.equal(element.className, 'foobar');
|
||||
assert.strictEqual(element.className, 'foobar');
|
||||
|
||||
element.classList.remove('foobar');
|
||||
assert(!element.classList.contains('far'));
|
||||
assert(!element.classList.contains('boo'));
|
||||
assert(!element.classList.contains('foobar'));
|
||||
assert.equal(element.className, '');
|
||||
assert.strictEqual(element.className, '');
|
||||
});
|
||||
|
||||
test('removeClass should consider hyphens', function () {
|
||||
@@ -83,7 +83,7 @@ suite('dom', () => {
|
||||
const div = $('div');
|
||||
assert(div);
|
||||
assert(div instanceof HTMLElement);
|
||||
assert.equal(div.tagName, 'DIV');
|
||||
assert.strictEqual(div.tagName, 'DIV');
|
||||
assert(!div.firstChild);
|
||||
});
|
||||
|
||||
@@ -91,42 +91,42 @@ suite('dom', () => {
|
||||
const div = $('div#foo');
|
||||
assert(div);
|
||||
assert(div instanceof HTMLElement);
|
||||
assert.equal(div.tagName, 'DIV');
|
||||
assert.equal(div.id, 'foo');
|
||||
assert.strictEqual(div.tagName, 'DIV');
|
||||
assert.strictEqual(div.id, 'foo');
|
||||
});
|
||||
|
||||
test('should buld nodes with class-name', () => {
|
||||
const div = $('div.foo');
|
||||
assert(div);
|
||||
assert(div instanceof HTMLElement);
|
||||
assert.equal(div.tagName, 'DIV');
|
||||
assert.equal(div.className, 'foo');
|
||||
assert.strictEqual(div.tagName, 'DIV');
|
||||
assert.strictEqual(div.className, 'foo');
|
||||
});
|
||||
|
||||
test('should build nodes with attributes', () => {
|
||||
let div = $('div', { class: 'test' });
|
||||
assert.equal(div.className, 'test');
|
||||
assert.strictEqual(div.className, 'test');
|
||||
|
||||
div = $('div', undefined);
|
||||
assert.equal(div.className, '');
|
||||
assert.strictEqual(div.className, '');
|
||||
});
|
||||
|
||||
test('should build nodes with children', () => {
|
||||
let div = $('div', undefined, $('span', { id: 'demospan' }));
|
||||
let firstChild = div.firstChild as HTMLElement;
|
||||
assert.equal(firstChild.tagName, 'SPAN');
|
||||
assert.equal(firstChild.id, 'demospan');
|
||||
assert.strictEqual(firstChild.tagName, 'SPAN');
|
||||
assert.strictEqual(firstChild.id, 'demospan');
|
||||
|
||||
div = $('div', undefined, 'hello');
|
||||
|
||||
assert.equal(div.firstChild && div.firstChild.textContent, 'hello');
|
||||
assert.strictEqual(div.firstChild && div.firstChild.textContent, 'hello');
|
||||
});
|
||||
|
||||
test('should build nodes with text children', () => {
|
||||
let div = $('div', undefined, 'foobar');
|
||||
let firstChild = div.firstChild as HTMLElement;
|
||||
assert.equal(firstChild.tagName, undefined);
|
||||
assert.equal(firstChild.textContent, 'foobar');
|
||||
assert.strictEqual(firstChild.tagName, undefined);
|
||||
assert.strictEqual(firstChild.textContent, 'foobar');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,53 +9,53 @@ import { sha1Hex } from 'vs/base/browser/hash';
|
||||
|
||||
suite('Hash', () => {
|
||||
test('string', () => {
|
||||
assert.equal(hash('hello'), hash('hello'));
|
||||
assert.notEqual(hash('hello'), hash('world'));
|
||||
assert.notEqual(hash('hello'), hash('olleh'));
|
||||
assert.notEqual(hash('hello'), hash('Hello'));
|
||||
assert.notEqual(hash('hello'), hash('Hello '));
|
||||
assert.notEqual(hash('h'), hash('H'));
|
||||
assert.notEqual(hash('-'), hash('_'));
|
||||
assert.strictEqual(hash('hello'), hash('hello'));
|
||||
assert.notStrictEqual(hash('hello'), hash('world'));
|
||||
assert.notStrictEqual(hash('hello'), hash('olleh'));
|
||||
assert.notStrictEqual(hash('hello'), hash('Hello'));
|
||||
assert.notStrictEqual(hash('hello'), hash('Hello '));
|
||||
assert.notStrictEqual(hash('h'), hash('H'));
|
||||
assert.notStrictEqual(hash('-'), hash('_'));
|
||||
});
|
||||
|
||||
test('number', () => {
|
||||
assert.equal(hash(1), hash(1));
|
||||
assert.notEqual(hash(0), hash(1));
|
||||
assert.notEqual(hash(1), hash(-1));
|
||||
assert.notEqual(hash(0x12345678), hash(0x123456789));
|
||||
assert.strictEqual(hash(1), hash(1));
|
||||
assert.notStrictEqual(hash(0), hash(1));
|
||||
assert.notStrictEqual(hash(1), hash(-1));
|
||||
assert.notStrictEqual(hash(0x12345678), hash(0x123456789));
|
||||
});
|
||||
|
||||
test('boolean', () => {
|
||||
assert.equal(hash(true), hash(true));
|
||||
assert.notEqual(hash(true), hash(false));
|
||||
assert.strictEqual(hash(true), hash(true));
|
||||
assert.notStrictEqual(hash(true), hash(false));
|
||||
});
|
||||
|
||||
test('array', () => {
|
||||
assert.equal(hash([1, 2, 3]), hash([1, 2, 3]));
|
||||
assert.equal(hash(['foo', 'bar']), hash(['foo', 'bar']));
|
||||
assert.equal(hash([]), hash([]));
|
||||
assert.equal(hash([]), hash(new Array()));
|
||||
assert.notEqual(hash(['foo', 'bar']), hash(['bar', 'foo']));
|
||||
assert.notEqual(hash(['foo', 'bar']), hash(['bar', 'foo', null]));
|
||||
assert.notEqual(hash(['foo', 'bar', null]), hash(['bar', 'foo', null]));
|
||||
assert.notEqual(hash(['foo', 'bar']), hash(['bar', 'foo', undefined]));
|
||||
assert.notEqual(hash(['foo', 'bar', undefined]), hash(['bar', 'foo', undefined]));
|
||||
assert.notEqual(hash(['foo', 'bar', null]), hash(['foo', 'bar', undefined]));
|
||||
assert.strictEqual(hash([1, 2, 3]), hash([1, 2, 3]));
|
||||
assert.strictEqual(hash(['foo', 'bar']), hash(['foo', 'bar']));
|
||||
assert.strictEqual(hash([]), hash([]));
|
||||
assert.strictEqual(hash([]), hash(new Array()));
|
||||
assert.notStrictEqual(hash(['foo', 'bar']), hash(['bar', 'foo']));
|
||||
assert.notStrictEqual(hash(['foo', 'bar']), hash(['bar', 'foo', null]));
|
||||
assert.notStrictEqual(hash(['foo', 'bar', null]), hash(['bar', 'foo', null]));
|
||||
assert.notStrictEqual(hash(['foo', 'bar']), hash(['bar', 'foo', undefined]));
|
||||
assert.notStrictEqual(hash(['foo', 'bar', undefined]), hash(['bar', 'foo', undefined]));
|
||||
assert.notStrictEqual(hash(['foo', 'bar', null]), hash(['foo', 'bar', undefined]));
|
||||
});
|
||||
|
||||
test('object', () => {
|
||||
assert.equal(hash({}), hash({}));
|
||||
assert.equal(hash({}), hash(Object.create(null)));
|
||||
assert.equal(hash({ 'foo': 'bar' }), hash({ 'foo': 'bar' }));
|
||||
assert.equal(hash({ 'foo': 'bar', 'foo2': undefined }), hash({ 'foo2': undefined, 'foo': 'bar' }));
|
||||
assert.notEqual(hash({ 'foo': 'bar' }), hash({ 'foo': 'bar2' }));
|
||||
assert.notEqual(hash({}), hash([]));
|
||||
assert.strictEqual(hash({}), hash({}));
|
||||
assert.strictEqual(hash({}), hash(Object.create(null)));
|
||||
assert.strictEqual(hash({ 'foo': 'bar' }), hash({ 'foo': 'bar' }));
|
||||
assert.strictEqual(hash({ 'foo': 'bar', 'foo2': undefined }), hash({ 'foo2': undefined, 'foo': 'bar' }));
|
||||
assert.notStrictEqual(hash({ 'foo': 'bar' }), hash({ 'foo': 'bar2' }));
|
||||
assert.notStrictEqual(hash({}), hash([]));
|
||||
});
|
||||
|
||||
test('array - unexpected collision', function () {
|
||||
const a = hash([undefined, undefined, undefined, undefined, undefined]);
|
||||
const b = hash([undefined, undefined, 'HHHHHH', [{ line: 0, character: 0 }, { line: 0, character: 0 }], undefined]);
|
||||
assert.notEqual(a, b);
|
||||
assert.notStrictEqual(a, b);
|
||||
});
|
||||
|
||||
test('all different', () => {
|
||||
@@ -65,9 +65,9 @@ suite('Hash', () => {
|
||||
];
|
||||
const hashes: number[] = candidates.map(hash);
|
||||
for (let i = 0; i < hashes.length; i++) {
|
||||
assert.equal(hashes[i], hash(candidates[i])); // verify that repeated invocation returns the same hash
|
||||
assert.strictEqual(hashes[i], hash(candidates[i])); // verify that repeated invocation returns the same hash
|
||||
for (let k = i + 1; k < hashes.length; k++) {
|
||||
assert.notEqual(hashes[i], hashes[k], `Same hash ${hashes[i]} for ${JSON.stringify(candidates[i])} and ${JSON.stringify(candidates[k])}`);
|
||||
assert.notStrictEqual(hashes[i], hashes[k], `Same hash ${hashes[i]} for ${JSON.stringify(candidates[i])} and ${JSON.stringify(candidates[k])}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -79,11 +79,11 @@ suite('Hash', () => {
|
||||
const hash = new StringSHA1();
|
||||
hash.update(str);
|
||||
let actual = hash.digest();
|
||||
assert.equal(actual, expected);
|
||||
assert.strictEqual(actual, expected);
|
||||
|
||||
// Test with crypto.subtle
|
||||
actual = await sha1Hex(str);
|
||||
assert.equal(actual, expected);
|
||||
assert.strictEqual(actual, expected);
|
||||
}
|
||||
|
||||
test('sha1-1', () => {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
|
||||
|
||||
@@ -13,50 +14,50 @@ suite('HighlightedLabel', () => {
|
||||
});
|
||||
|
||||
test('empty label', function () {
|
||||
assert.equal(label.element.innerHTML, '');
|
||||
assert.strictEqual(label.element.innerHTML, '');
|
||||
});
|
||||
|
||||
test('no decorations', function () {
|
||||
label.set('hello');
|
||||
assert.equal(label.element.innerHTML, '<span>hello</span>');
|
||||
assert.strictEqual(label.element.innerHTML, '<span>hello</span>');
|
||||
});
|
||||
|
||||
test('escape html', function () {
|
||||
label.set('hel<lo');
|
||||
assert.equal(label.element.innerHTML, '<span>hel<lo</span>');
|
||||
assert.strictEqual(label.element.innerHTML, '<span>hel<lo</span>');
|
||||
});
|
||||
|
||||
test('everything highlighted', function () {
|
||||
label.set('hello', [{ start: 0, end: 5 }]);
|
||||
assert.equal(label.element.innerHTML, '<span class="highlight">hello</span>');
|
||||
assert.strictEqual(label.element.innerHTML, '<span class="highlight">hello</span>');
|
||||
});
|
||||
|
||||
test('beginning highlighted', function () {
|
||||
label.set('hellothere', [{ start: 0, end: 5 }]);
|
||||
assert.equal(label.element.innerHTML, '<span class="highlight">hello</span><span>there</span>');
|
||||
assert.strictEqual(label.element.innerHTML, '<span class="highlight">hello</span><span>there</span>');
|
||||
});
|
||||
|
||||
test('ending highlighted', function () {
|
||||
label.set('goodbye', [{ start: 4, end: 7 }]);
|
||||
assert.equal(label.element.innerHTML, '<span>good</span><span class="highlight">bye</span>');
|
||||
assert.strictEqual(label.element.innerHTML, '<span>good</span><span class="highlight">bye</span>');
|
||||
});
|
||||
|
||||
test('middle highlighted', function () {
|
||||
label.set('foobarfoo', [{ start: 3, end: 6 }]);
|
||||
assert.equal(label.element.innerHTML, '<span>foo</span><span class="highlight">bar</span><span>foo</span>');
|
||||
assert.strictEqual(label.element.innerHTML, '<span>foo</span><span class="highlight">bar</span><span>foo</span>');
|
||||
});
|
||||
|
||||
test('escapeNewLines', () => {
|
||||
|
||||
let highlights = [{ start: 0, end: 5 }, { start: 7, end: 9 }, { start: 11, end: 12 }];// before,after,after
|
||||
let escaped = HighlightedLabel.escapeNewLines('ACTION\r\n_TYPE2', highlights);
|
||||
assert.equal(escaped, 'ACTION\u23CE_TYPE2');
|
||||
assert.deepEqual(highlights, [{ start: 0, end: 5 }, { start: 6, end: 8 }, { start: 10, end: 11 }]);
|
||||
assert.strictEqual(escaped, 'ACTION\u23CE_TYPE2');
|
||||
assert.deepStrictEqual(highlights, [{ start: 0, end: 5 }, { start: 6, end: 8 }, { start: 10, end: 11 }]);
|
||||
|
||||
highlights = [{ start: 5, end: 9 }, { start: 11, end: 12 }];//overlap,after
|
||||
escaped = HighlightedLabel.escapeNewLines('ACTION\r\n_TYPE2', highlights);
|
||||
assert.equal(escaped, 'ACTION\u23CE_TYPE2');
|
||||
assert.deepEqual(highlights, [{ start: 5, end: 8 }, { start: 10, end: 11 }]);
|
||||
assert.strictEqual(escaped, 'ACTION\u23CE_TYPE2');
|
||||
assert.deepStrictEqual(highlights, [{ start: 5, end: 8 }, { start: 10, end: 11 }]);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,45 +3,45 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';
|
||||
import * as assert from 'assert';
|
||||
import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';
|
||||
|
||||
suite('renderLabelWithIcons', () => {
|
||||
|
||||
test('no icons', () => {
|
||||
const result = renderLabelWithIcons(' hello World .');
|
||||
|
||||
assert.equal(elementsToString(result), ' hello World .');
|
||||
assert.strictEqual(elementsToString(result), ' hello World .');
|
||||
});
|
||||
|
||||
test('icons only', () => {
|
||||
const result = renderLabelWithIcons('$(alert)');
|
||||
|
||||
assert.equal(elementsToString(result), '<span class="codicon codicon-alert"></span>');
|
||||
assert.strictEqual(elementsToString(result), '<span class="codicon codicon-alert"></span>');
|
||||
});
|
||||
|
||||
test('icon and non-icon strings', () => {
|
||||
const result = renderLabelWithIcons(` $(alert) Unresponsive`);
|
||||
|
||||
assert.equal(elementsToString(result), ' <span class="codicon codicon-alert"></span> Unresponsive');
|
||||
assert.strictEqual(elementsToString(result), ' <span class="codicon codicon-alert"></span> Unresponsive');
|
||||
});
|
||||
|
||||
test('multiple icons', () => {
|
||||
const result = renderLabelWithIcons('$(check)$(error)');
|
||||
|
||||
assert.equal(elementsToString(result), '<span class="codicon codicon-check"></span><span class="codicon codicon-error"></span>');
|
||||
assert.strictEqual(elementsToString(result), '<span class="codicon codicon-check"></span><span class="codicon codicon-error"></span>');
|
||||
});
|
||||
|
||||
test('escaped icons', () => {
|
||||
const result = renderLabelWithIcons('\\$(escaped)');
|
||||
|
||||
assert.equal(elementsToString(result), '$(escaped)');
|
||||
assert.strictEqual(elementsToString(result), '$(escaped)');
|
||||
});
|
||||
|
||||
test('icon with animation', () => {
|
||||
const result = renderLabelWithIcons('$(zip~anim)');
|
||||
|
||||
assert.equal(elementsToString(result), '<span class="codicon codicon-zip codicon-modifier-anim"></span>');
|
||||
assert.strictEqual(elementsToString(result), '<span class="codicon codicon-zip codicon-modifier-anim"></span>');
|
||||
});
|
||||
|
||||
const elementsToString = (elements: Array<HTMLElement | string>): string => {
|
||||
|
||||
@@ -9,20 +9,20 @@ import { layout, LayoutAnchorPosition } from 'vs/base/browser/ui/contextview/con
|
||||
suite('Contextview', function () {
|
||||
|
||||
test('layout', () => {
|
||||
assert.equal(layout(200, 20, { offset: 0, size: 0, position: LayoutAnchorPosition.Before }), 0);
|
||||
assert.equal(layout(200, 20, { offset: 50, size: 0, position: LayoutAnchorPosition.Before }), 50);
|
||||
assert.equal(layout(200, 20, { offset: 200, size: 0, position: LayoutAnchorPosition.Before }), 180);
|
||||
assert.strictEqual(layout(200, 20, { offset: 0, size: 0, position: LayoutAnchorPosition.Before }), 0);
|
||||
assert.strictEqual(layout(200, 20, { offset: 50, size: 0, position: LayoutAnchorPosition.Before }), 50);
|
||||
assert.strictEqual(layout(200, 20, { offset: 200, size: 0, position: LayoutAnchorPosition.Before }), 180);
|
||||
|
||||
assert.equal(layout(200, 20, { offset: 0, size: 0, position: LayoutAnchorPosition.After }), 0);
|
||||
assert.equal(layout(200, 20, { offset: 50, size: 0, position: LayoutAnchorPosition.After }), 30);
|
||||
assert.equal(layout(200, 20, { offset: 200, size: 0, position: LayoutAnchorPosition.After }), 180);
|
||||
assert.strictEqual(layout(200, 20, { offset: 0, size: 0, position: LayoutAnchorPosition.After }), 0);
|
||||
assert.strictEqual(layout(200, 20, { offset: 50, size: 0, position: LayoutAnchorPosition.After }), 30);
|
||||
assert.strictEqual(layout(200, 20, { offset: 200, size: 0, position: LayoutAnchorPosition.After }), 180);
|
||||
|
||||
assert.equal(layout(200, 20, { offset: 0, size: 50, position: LayoutAnchorPosition.Before }), 50);
|
||||
assert.equal(layout(200, 20, { offset: 50, size: 50, position: LayoutAnchorPosition.Before }), 100);
|
||||
assert.equal(layout(200, 20, { offset: 150, size: 50, position: LayoutAnchorPosition.Before }), 130);
|
||||
assert.strictEqual(layout(200, 20, { offset: 0, size: 50, position: LayoutAnchorPosition.Before }), 50);
|
||||
assert.strictEqual(layout(200, 20, { offset: 50, size: 50, position: LayoutAnchorPosition.Before }), 100);
|
||||
assert.strictEqual(layout(200, 20, { offset: 150, size: 50, position: LayoutAnchorPosition.Before }), 130);
|
||||
|
||||
assert.equal(layout(200, 20, { offset: 0, size: 50, position: LayoutAnchorPosition.After }), 50);
|
||||
assert.equal(layout(200, 20, { offset: 50, size: 50, position: LayoutAnchorPosition.After }), 30);
|
||||
assert.equal(layout(200, 20, { offset: 150, size: 50, position: LayoutAnchorPosition.After }), 130);
|
||||
assert.strictEqual(layout(200, 20, { offset: 0, size: 50, position: LayoutAnchorPosition.After }), 50);
|
||||
assert.strictEqual(layout(200, 20, { offset: 50, size: 50, position: LayoutAnchorPosition.After }), 30);
|
||||
assert.strictEqual(layout(200, 20, { offset: 150, size: 50, position: LayoutAnchorPosition.After }), 130);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user