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,23 +1,12 @@
Before:
Save g:ale_pony_ponyc_options
unlet! g:ale_pony_ponyc_options
unlet! b:ale_pony_ponyc_options
runtime ale_linters/pony/ponyc.vim
call ale#assert#SetUpLinterTest('pony', 'ponyc')
After:
Restore
unlet! b:ale_pony_ponyc_options
call ale#linter#Reset()
call ale#assert#TearDownLinterTest()
Execute(The options should be used in the command):
AssertEqual
\ ale#Escape('ponyc') . ' --pass paint',
\ ale_linters#pony#ponyc#GetCommand(bufnr(''))
AssertLinter 'ponyc', ale#Escape('ponyc') . ' --pass paint'
let b:ale_pony_ponyc_options = 'foobar'
AssertEqual
\ ale#Escape('ponyc') . ' foobar',
\ ale_linters#pony#ponyc#GetCommand(bufnr(''))
AssertLinter 'ponyc', ale#Escape('ponyc') . ' foobar'