Skip to content

Commit

Permalink
Merge pull request #66706 from Pranshu258/addStrictNullChecks_FindMod…
Browse files Browse the repository at this point in the history
…elTests

 Added strict null checks for findModel.test.ts
  • Loading branch information
alexdima authored Feb 7, 2019
2 parents 97479e3 + d59b296 commit ffa778a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/vs/editor/contrib/find/test/findModel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ suite('FindModel', () => {
]
);

editor.getModel().setValue('hello\nhi');
editor!.getModel()!.setValue('hello\nhi');
assertFindState(
editor,
[1, 1, 1, 1],
Expand Down Expand Up @@ -1538,7 +1538,7 @@ suite('FindModel', () => {

findModel.selectAllMatches();

assert.deepEqual(editor.getSelections().map(s => s.toString()), [
assert.deepEqual(editor!.getSelections()!.map(s => s.toString()), [
new Selection(6, 14, 6, 19),
new Selection(6, 27, 6, 32),
new Selection(7, 14, 7, 19),
Expand Down Expand Up @@ -1582,14 +1582,14 @@ suite('FindModel', () => {

findModel.selectAllMatches();

assert.deepEqual(editor.getSelections().map(s => s.toString()), [
assert.deepEqual(editor!.getSelections()!.map(s => s.toString()), [
new Selection(7, 14, 7, 19),
new Selection(6, 14, 6, 19),
new Selection(6, 27, 6, 32),
new Selection(8, 14, 8, 19)
].map(s => s.toString()));

assert.deepEqual(editor.getSelection().toString(), new Selection(7, 14, 7, 19).toString());
assert.deepEqual(editor!.getSelection()!.toString(), new Selection(7, 14, 7, 19).toString());

assertFindState(
editor,
Expand Down Expand Up @@ -1984,7 +1984,7 @@ suite('FindModel', () => {
for (let i = 0; i < 1100; i++) {
initialText += 'line' + i + '\n';
}
editor.getModel().setValue(initialText);
editor!.getModel()!.setValue(initialText);
let findState = new FindReplaceState();
findState.change({ searchString: '^', replaceString: 'a ', isRegex: true }, false);
let findModel = new FindModelBoundToEditorModel(editor, findState);
Expand All @@ -1996,7 +1996,7 @@ suite('FindModel', () => {
expectedText += 'a line' + i + '\n';
}
expectedText += 'a ';
assert.equal(editor.getModel().getValue(), expectedText);
assert.equal(editor!.getModel()!.getValue(), expectedText);

findModel.dispose();
findState.dispose();
Expand Down

0 comments on commit ffa778a

Please sign in to comment.