(vimState: VimState, docState: DocState)
| 213 | } |
| 214 | |
| 215 | function assertDocState(vimState: VimState, docState: DocState): void { |
| 216 | assertEqualLines(docState.lines); |
| 217 | |
| 218 | const simplify = (position: Position) => ({ line: position.line, character: position.character }); |
| 219 | const compare = ( |
| 220 | a: { line: number; character: number }, |
| 221 | b: { line: number; character: number }, |
| 222 | ) => { |
| 223 | if (a.line !== b.line) { |
| 224 | return a.line - b.line; |
| 225 | } |
| 226 | return a.character - b.character; |
| 227 | }; |
| 228 | // TODO: Assert selections match vimState.cursors |
| 229 | assert.deepEqual( |
| 230 | vimState.cursors.map((cursor) => simplify(cursor.stop)).sort(compare), |
| 231 | docState.cursors.map(simplify).sort(compare), |
| 232 | 'Cursors are wrong.', |
| 233 | ); |
| 234 | } |
| 235 | |
| 236 | export async function testIt(testObj: ITestObject): Promise<ModeHandler> { |
| 237 | const editor = vscode.window.activeTextEditor; |
no test coverage detected