Change how bibtex formatter alignment is checked in test

This commit is contained in:
James Yu 2023-01-12 22:18:39 +08:00
parent aae35d2652
commit be0b0c2eca
2 changed files with 3 additions and 3 deletions

View File

@ -264,13 +264,13 @@ suite('Formatter test suite', () => {
let lines = vscode.window.activeTextEditor?.document.getText().split('\n')
assert.ok(lines)
const allEqual = (arr: number[]) => arr.every(val => val === arr[0])
assert.ok(!allEqual(lines.slice(9, 18).map(line => line.indexOf('='))))
assert.ok(!allEqual(lines.filter(line => line.includes('=')).map(line => line.indexOf('='))))
await vscode.workspace.getConfiguration('latex-workshop').update('bibtex-format.align-equal.enabled', true)
await vscode.commands.executeCommand('editor.action.formatDocument')
await test.sleep(1000)
lines = vscode.window.activeTextEditor?.document.getText().split('\n')
assert.ok(lines)
assert.ok(allEqual(lines.slice(9, 18).map(line => line.indexOf('='))))
assert.ok(allEqual(lines.filter(line => line.includes('=')).map(line => line.indexOf('='))))
})
})

View File

@ -63,7 +63,7 @@ function log(fixtureName: string, testName: string, counter: string) {
cachedLog.CACHED_EXTLOG.join('\n') +
'\n\n' + new Array(80).fill('=').join('') + '\n\n' +
cachedLog.CACHED_COMPILER.join('\n') +
'\n\n' + new Array(80).fill('=').join('') +
'\n\n' + new Array(80).fill('=').join('') + '\n\n' +
vscode.window.activeTextEditor?.document.uri.fsPath + '\n\n' +
vscode.window.activeTextEditor?.document.getText())
}