Cover the SaveEvent function with a test
This commit is contained in:
parent
a4ffd2f37c
commit
35913d9ce7
@ -224,3 +224,30 @@ Execute(Linter errors from files should be kept when no other linters are run):
|
|||||||
\ 'type': 'E',
|
\ 'type': 'E',
|
||||||
\ },
|
\ },
|
||||||
\], GetSimplerLoclist()
|
\], GetSimplerLoclist()
|
||||||
|
|
||||||
|
Execute(The Save event should respect the buffer number):
|
||||||
|
let g:ale_linters = {'foobar': ['lint_file_linter']}
|
||||||
|
Assert filereadable(expand('%:p')), 'The file was not readable'
|
||||||
|
|
||||||
|
call ale#events#SaveEvent(bufnr('') + 1)
|
||||||
|
|
||||||
|
" We shouldn't get any prblems yet.
|
||||||
|
AssertEqual [], GetSimplerLoclist()
|
||||||
|
|
||||||
|
call ale#events#SaveEvent(bufnr(''))
|
||||||
|
|
||||||
|
" We should get them now we used the right buffer number.
|
||||||
|
AssertEqual [
|
||||||
|
\ {
|
||||||
|
\ 'lnum': 1,
|
||||||
|
\ 'col': 3,
|
||||||
|
\ 'text': 'file warning',
|
||||||
|
\ 'type': 'W',
|
||||||
|
\ },
|
||||||
|
\ {
|
||||||
|
\ 'lnum': 2,
|
||||||
|
\ 'col': 3,
|
||||||
|
\ 'text': 'file error',
|
||||||
|
\ 'type': 'E',
|
||||||
|
\ },
|
||||||
|
\], GetSimplerLoclist()
|
||||||
|
Loading…
Reference in New Issue
Block a user