Skip to content

Commit

Permalink
fix tests compile
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Sep 14, 2022
1 parent 5600459 commit d1710fb
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,20 +213,23 @@ suite('bracket matching', () => {
test('Removes brackets', () => {
const editor = createCodeEditorWithBrackets('var x = (3 + (5-7)); y();');
const bracketMatchingController = disposables.add(editor.registerAndInstantiateContribution(BracketMatchingController.ID, BracketMatchingController));
function removeBrackets() {
bracketMatchingController.replaceBrackets('', '');
}

// position before the bracket
editor.setPosition(new Position(1, 9));
bracketMatchingController.removeBrackets();
removeBrackets();
assert.deepStrictEqual(editor.getModel().getValue(), 'var x = 3 + (5-7); y();');
editor.getModel().setValue('var x = (3 + (5-7)); y();');

// position between brackets
editor.setPosition(new Position(1, 16));
bracketMatchingController.removeBrackets();
removeBrackets();
assert.deepStrictEqual(editor.getModel().getValue(), 'var x = (3 + 5-7); y();');
bracketMatchingController.removeBrackets();
removeBrackets();
assert.deepStrictEqual(editor.getModel().getValue(), 'var x = 3 + 5-7; y();');
bracketMatchingController.removeBrackets();
removeBrackets();
assert.deepStrictEqual(editor.getModel().getValue(), 'var x = 3 + 5-7; y();');
});
});

0 comments on commit d1710fb

Please sign in to comment.