2017-05-31 21:55:23 +00:00
|
|
|
Before:
|
|
|
|
Save g:ale_set_loclist
|
|
|
|
Save g:ale_set_quickfix
|
2017-08-19 13:28:51 +00:00
|
|
|
Save g:ale_buffer_info
|
2017-09-10 23:47:27 +00:00
|
|
|
Save g:ale_set_lists_synchronously
|
2017-05-31 21:55:23 +00:00
|
|
|
|
2017-08-19 13:28:51 +00:00
|
|
|
let g:ale_buffer_info = {}
|
2017-05-31 21:55:23 +00:00
|
|
|
let g:ale_set_loclist = 0
|
|
|
|
let g:ale_set_quickfix = 0
|
2017-09-10 23:47:27 +00:00
|
|
|
let g:ale_set_lists_synchronously = 1
|
2017-05-31 21:55:23 +00:00
|
|
|
|
2017-09-10 23:47:27 +00:00
|
|
|
call ale#test#SetDirectory('/testplugin/test')
|
2017-05-31 21:55:23 +00:00
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
|
|
|
call setloclist(0, [])
|
|
|
|
call setqflist([])
|
|
|
|
|
2017-09-10 23:47:27 +00:00
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
|
2017-05-31 21:55:23 +00:00
|
|
|
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': '',
|
2018-07-23 19:41:06 +00:00
|
|
|
\}], ale#test#GetLoclistWithoutModule()
|
2017-05-31 21:55:23 +00:00
|
|
|
|
|
|
|
if !has('nvim')
|
2017-09-10 23:47:27 +00:00
|
|
|
AssertEqual
|
2017-12-19 18:23:09 +00:00
|
|
|
\ {'title': ale#path#Simplify(getcwd() . '/foo')},
|
2017-09-10 23:47:27 +00:00
|
|
|
\ getloclist(0, {'title': ''})
|
2017-05-31 21:55:23 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
Execute(The quickfix titles should be set appropriately):
|
|
|
|
silent noautocmd file foo
|
|
|
|
|
|
|
|
let g:ale_set_quickfix = 1
|
|
|
|
|
2017-08-19 13:28:51 +00:00
|
|
|
let g:ale_buffer_info[bufnr('')] = {
|
|
|
|
\ 'loclist': [{'bufnr': bufnr(''), 'lnum': 5, 'col': 5, 'text': 'x', 'type': 'E'}],
|
|
|
|
\}
|
|
|
|
|
2017-05-31 21:55:23 +00: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': '',
|
2018-07-23 19:41:06 +00:00
|
|
|
\}], ale#test#GetQflistWithoutModule()
|
2017-05-31 21:55:23 +00:00
|
|
|
|
|
|
|
if !has('nvim')
|
2017-09-10 23:47:27 +00:00
|
|
|
AssertEqual
|
2017-12-19 18:23:09 +00:00
|
|
|
\ {'title': ale#path#Simplify(getcwd() . '/foo')},
|
2017-09-10 23:47:27 +00:00
|
|
|
\ getqflist({'title': ''})
|
2017-05-31 21:55:23 +00:00
|
|
|
endif
|