2017-05-31 17:55:23 -04:00
|
|
|
Before:
|
|
|
|
Save g:ale_set_loclist
|
|
|
|
Save g:ale_set_quickfix
|
2017-08-19 09:28:51 -04:00
|
|
|
Save g:ale_buffer_info
|
2017-05-31 17:55:23 -04:00
|
|
|
|
2017-08-19 09:28:51 -04:00
|
|
|
let g:ale_buffer_info = {}
|
2017-05-31 17:55:23 -04:00
|
|
|
let g:ale_set_loclist = 0
|
|
|
|
let g:ale_set_quickfix = 0
|
|
|
|
|
|
|
|
silent! cd /testplugin/test
|
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
|
|
|
call setloclist(0, [])
|
|
|
|
call setqflist([])
|
|
|
|
|
|
|
|
Execute(The loclist titles should be set appropriately):
|
|
|
|
silent noautocmd file foo
|
|
|
|
|
|
|
|
let g:ale_set_loclist = 1
|
|
|
|
|
|
|
|
call ale#list#SetLists(bufnr(''), [
|
|
|
|
\ {'bufnr': bufnr(''), 'lnum': 5, 'col': 5, 'text': 'x', 'type': 'E'},
|
|
|
|
\])
|
|
|
|
|
|
|
|
AssertEqual [{
|
|
|
|
\ 'lnum': 5,
|
|
|
|
\ 'bufnr': bufnr(''),
|
|
|
|
\ 'col': 5,
|
|
|
|
\ 'text': 'x',
|
|
|
|
\ 'valid': 1,
|
|
|
|
\ 'vcol': 0,
|
|
|
|
\ 'nr': 0,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'pattern': '',
|
|
|
|
\}], getloclist(0)
|
|
|
|
|
|
|
|
if !has('nvim')
|
|
|
|
AssertEqual {'title': getcwd() . '/foo'}, getloclist(0, {'title': ''})
|
|
|
|
endif
|
|
|
|
|
|
|
|
Execute(The quickfix titles should be set appropriately):
|
|
|
|
silent noautocmd file foo
|
|
|
|
|
|
|
|
let g:ale_set_quickfix = 1
|
|
|
|
|
2017-08-19 09:28:51 -04:00
|
|
|
let g:ale_buffer_info[bufnr('')] = {
|
|
|
|
\ 'loclist': [{'bufnr': bufnr(''), 'lnum': 5, 'col': 5, 'text': 'x', 'type': 'E'}],
|
|
|
|
\}
|
|
|
|
|
2017-05-31 17:55:23 -04:00
|
|
|
call ale#list#SetLists(bufnr(''), [
|
|
|
|
\ {'bufnr': bufnr(''), 'lnum': 5, 'col': 5, 'text': 'x', 'type': 'E'},
|
|
|
|
\])
|
|
|
|
AssertEqual [{
|
|
|
|
\ 'lnum': 5,
|
|
|
|
\ 'bufnr': bufnr(''),
|
|
|
|
\ 'col': 5,
|
|
|
|
\ 'text': 'x',
|
|
|
|
\ 'valid': 1,
|
|
|
|
\ 'vcol': 0,
|
|
|
|
\ 'nr': 0,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'pattern': '',
|
|
|
|
\}], getqflist()
|
|
|
|
|
|
|
|
if !has('nvim')
|
|
|
|
AssertEqual {'title': getcwd() . '/foo'}, getqflist({'title': ''})
|
|
|
|
endif
|