Massively reduce the amount of code needed for linter tests

This commit is contained in:
w0rp
2018-07-15 18:24:53 +01:00
parent 5155a35a80
commit a42999a639
138 changed files with 1447 additions and 3017 deletions

View File

@@ -1,20 +1,12 @@
Before:
Save g:ale_php_phpmd_executable
unlet! g:ale_php_phpmd_executable
runtime ale_linters/php/phpmd.vim
call ale#assert#SetUpLinterTest('php', 'phpmd')
After:
Restore
call ale#linter#Reset()
call ale#assert#TearDownLinterTest()
Execute(Custom executables should be used for the executable and command):
let g:ale_php_phpmd_executable = 'phpmd_test'
AssertEqual 'phpmd_test', ale_linters#php#phpmd#GetExecutable(bufnr(''))
AssertEqual
AssertLinter 'phpmd_test',
\ ale#Escape('phpmd_test')
\ . ' %s text cleancode,codesize,controversial,design,naming,unusedcode --ignore-violations-on-exit %t',
\ ale_linters#php#phpmd#GetCommand(bufnr(''))
\ . ' %s text cleancode,codesize,controversial,design,naming,unusedcode --ignore-violations-on-exit %t'