提交 e87867c9 编写于 作者: M Matt Bierner

Convert to async

上级 735f6a7b
......@@ -25,62 +25,56 @@ suite('Tests for Increment/Decrement Emmet Commands', () => {
`;
test('incrementNumberByOne', function (): any {
return withRandomFileEditor(contents, 'txt', (editor, doc) => {
return withRandomFileEditor(contents, 'txt', async (editor, doc) => {
editor.selections = [new Selection(1, 7, 1, 10), new Selection(2, 7, 2, 10)];
return incrementDecrement(1).then(() => {
assert.equal(doc.getText(), contents.replace('123', '124').replace('999', '1000'));
return Promise.resolve();
});
await incrementDecrement(1);
assert.equal(doc.getText(), contents.replace('123', '124').replace('999', '1000'));
return Promise.resolve();
});
});
test('incrementNumberByTen', function (): any {
return withRandomFileEditor(contents, 'txt', (editor, doc) => {
return withRandomFileEditor(contents, 'txt', async (editor, doc) => {
editor.selections = [new Selection(1, 7, 1, 10), new Selection(2, 7, 2, 10)];
return incrementDecrement(10).then(() => {
assert.equal(doc.getText(), contents.replace('123', '133').replace('999', '1009'));
return Promise.resolve();
});
await incrementDecrement(10);
assert.equal(doc.getText(), contents.replace('123', '133').replace('999', '1009'));
return Promise.resolve();
});
});
test('incrementNumberByOneTenth', function (): any {
return withRandomFileEditor(contents, 'txt', (editor, doc) => {
return withRandomFileEditor(contents, 'txt', async (editor, doc) => {
editor.selections = [new Selection(1, 7, 1, 13), new Selection(2, 7, 2, 12)];
return incrementDecrement(0.1).then(() => {
assert.equal(doc.getText(), contents.replace('123.43', '123.53').replace('999.9', '1000'));
return Promise.resolve();
});
await incrementDecrement(0.1);
assert.equal(doc.getText(), contents.replace('123.43', '123.53').replace('999.9', '1000'));
return Promise.resolve();
});
});
test('decrementNumberByOne', function (): any {
return withRandomFileEditor(contents, 'txt', (editor, doc) => {
return withRandomFileEditor(contents, 'txt', async (editor, doc) => {
editor.selections = [new Selection(1, 7, 1, 10), new Selection(3, 7, 3, 10)];
return incrementDecrement(-1).then(() => {
assert.equal(doc.getText(), contents.replace('123', '122').replace('100', '99'));
return Promise.resolve();
});
await incrementDecrement(-1);
assert.equal(doc.getText(), contents.replace('123', '122').replace('100', '99'));
return Promise.resolve();
});
});
test('decrementNumberByTen', function (): any {
return withRandomFileEditor(contents, 'txt', (editor, doc) => {
return withRandomFileEditor(contents, 'txt', async (editor, doc) => {
editor.selections = [new Selection(1, 7, 1, 10), new Selection(3, 7, 3, 10)];
return incrementDecrement(-10).then(() => {
assert.equal(doc.getText(), contents.replace('123', '113').replace('100', '90'));
return Promise.resolve();
});
await incrementDecrement(-10);
assert.equal(doc.getText(), contents.replace('123', '113').replace('100', '90'));
return Promise.resolve();
});
});
test('decrementNumberByOneTenth', function (): any {
return withRandomFileEditor(contents, 'txt', (editor, doc) => {
return withRandomFileEditor(contents, 'txt', async (editor, doc) => {
editor.selections = [new Selection(1, 7, 1, 13), new Selection(3, 7, 3, 10)];
return incrementDecrement(-0.1).then(() => {
assert.equal(doc.getText(), contents.replace('123.43', '123.33').replace('100', '99.9'));
return Promise.resolve();
});
await incrementDecrement(-0.1);
assert.equal(doc.getText(), contents.replace('123.43', '123.33').replace('100', '99.9'));
return Promise.resolve();
});
});
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册