mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 09:35:39 -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:
@@ -103,30 +103,18 @@ suite('Strings', () => {
|
||||
assert.equal(strings.overlap('full', 'full'), 4);
|
||||
assert.equal(strings.overlap('full', 'fulloverlap'), 4);
|
||||
});
|
||||
test('lcut', () => {
|
||||
assert.strictEqual(strings.lcut('foo bar', 0), '');
|
||||
assert.strictEqual(strings.lcut('foo bar', 1), 'bar');
|
||||
assert.strictEqual(strings.lcut('foo bar', 3), 'bar');
|
||||
assert.strictEqual(strings.lcut('foo bar', 4), 'bar'); // Leading whitespace trimmed
|
||||
assert.strictEqual(strings.lcut('foo bar', 5), 'foo bar');
|
||||
assert.strictEqual(strings.lcut('test string 0.1.2.3', 3), '2.3');
|
||||
|
||||
test('computeLineStarts', function () {
|
||||
function assertLineStart(text: string, ...offsets: number[]): void {
|
||||
const actual = strings.computeLineStarts(text);
|
||||
assert.equal(actual.length, offsets.length);
|
||||
if (actual.length !== offsets.length) {
|
||||
return;
|
||||
}
|
||||
while (offsets.length > 0) {
|
||||
assert.equal(actual.pop(), offsets.pop());
|
||||
}
|
||||
}
|
||||
|
||||
assertLineStart('', 0);
|
||||
assertLineStart('farboo', 0);
|
||||
assertLineStart('far\nboo', 0, 4);
|
||||
assertLineStart('far\rboo', 0, 4);
|
||||
assertLineStart('far\r\nboo', 0, 5);
|
||||
assertLineStart('far\n\rboo', 0, 4, 5);
|
||||
assertLineStart('far\n \rboo', 0, 4, 6);
|
||||
assertLineStart('far\nboo\nfar', 0, 4, 8);
|
||||
assert.strictEqual(strings.lcut('', 10), '');
|
||||
assert.strictEqual(strings.lcut('a', 10), 'a');
|
||||
});
|
||||
|
||||
|
||||
test('pad', function () {
|
||||
assert.strictEqual(strings.pad(1, 0), '1');
|
||||
assert.strictEqual(strings.pad(1, 1), '1');
|
||||
@@ -207,13 +195,6 @@ suite('Strings', () => {
|
||||
assert.strictEqual(' '.trim(), '');
|
||||
});
|
||||
|
||||
test('appendWithLimit', function () {
|
||||
assert.strictEqual(strings.appendWithLimit('ab', 'cd', 100), 'abcd');
|
||||
assert.strictEqual(strings.appendWithLimit('ab', 'cd', 2), '...cd');
|
||||
assert.strictEqual(strings.appendWithLimit('ab', 'cdefgh', 4), '...efgh');
|
||||
assert.strictEqual(strings.appendWithLimit('abcdef', 'ghijk', 7), '...efghijk');
|
||||
});
|
||||
|
||||
test('repeat', () => {
|
||||
assert.strictEqual(strings.repeat(' ', 4), ' ');
|
||||
assert.strictEqual(strings.repeat(' ', 1), ' ');
|
||||
|
||||
Reference in New Issue
Block a user