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-09-10 19:47:27 -04:00
|
|
|
Save g:ale_set_lists_synchronously
|
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
|
2017-09-10 19:47:27 -04:00
|
|
|
let g:ale_set_lists_synchronously = 1
|
2017-05-31 17:55:23 -04:00
|
|
|
|
2017-09-10 19:47:27 -04:00
|
|
|
call ale#test#SetDirectory('/testplugin/test')
|
2017-05-31 17:55:23 -04:00
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
|
|
|
call setloclist(0, [])
|
|
|
|
call setqflist([])
|
|
|
|
|
2017-09-10 19:47:27 -04:00
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
|
2017-05-31 17:55:23 -04: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 15:41:06 -04:00
|
|
|
\}], ale#test#GetLoclistWithoutModule()
|
2017-05-31 17:55:23 -04:00
|
|
|
|
|
|
|
if !has('nvim')
|
2017-09-10 19:47:27 -04:00
|
|
|
AssertEqual
|
2017-12-19 13:23:09 -05:00
|
|
|
\ {'title': ale#path#Simplify(getcwd() . '/foo')},
|
2017-09-10 19:47:27 -04:00
|
|
|
\ getloclist(0, {'title': ''})
|
2017-05-31 17:55:23 -04:00
|
|
|
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': '',
|
2018-07-23 15:41:06 -04:00
|
|
|
\}], ale#test#GetQflistWithoutModule()
|
2017-05-31 17:55:23 -04:00
|
|
|
|
|
|
|
if !has('nvim')
|
2017-09-10 19:47:27 -04:00
|
|
|
AssertEqual
|
2017-12-19 13:23:09 -05:00
|
|
|
\ {'title': ale#path#Simplify(getcwd() . '/foo')},
|
2017-09-10 19:47:27 -04:00
|
|
|
\ getqflist({'title': ''})
|
2017-05-31 17:55:23 -04:00
|
|
|
endif
|