Skip to content

Commit

Permalink
Fixed broken assumption in test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
msfterictraut committed May 2, 2020
1 parent d6d92a8 commit 0f4a920
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/src/tests/harness/fourslash/testState.ts
Expand Up @@ -640,8 +640,12 @@ export class TestState {
if (command.command === 'pyright.createtypestub') {
await this._verifyFiles(files);
} else if (command.command === 'pyright.organizeimports') {
//organize imports command can only be used on 1 file at a time, so there is no looping over "commandResult" or "files"
const actualText = (commandResult as TextEdit[])[0].newText;
// Organize imports command can be used on only one file at a time,
// so there is no looping over "commandResult" or "files".
const workspaceEditResult = commandResult as WorkspaceEdit;
const uri = Object.keys(workspaceEditResult.changes!)[0];
const textEdit = workspaceEditResult.changes![uri][0];
const actualText = textEdit.newText;
const expectedText: string = Object.values(files)[0];

if (actualText != expectedText) {
Expand Down

0 comments on commit 0f4a920

Please sign in to comment.