mirror of
https://github.com/James-Yu/LaTeX-Workshop.git
synced 2024-10-04 23:27:20 +03:00
Change how bibtex formatter alignment is checked in test
This commit is contained in:
parent
aae35d2652
commit
be0b0c2eca
@ -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('='))))
|
||||
})
|
||||
})
|
||||
|
@ -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())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user