2016-10-13 13:50:57 +00:00
|
|
|
Before:
|
2016-10-23 21:41:00 +00:00
|
|
|
let g:ale_statusline_format = ['%sE', '%sW', 'OKIE']
|
|
|
|
|
|
|
|
After:
|
|
|
|
let g:ale_buffer_info = {}
|
2016-10-13 13:50:57 +00:00
|
|
|
|
|
|
|
Execute (Count should be 0 when data is empty):
|
2016-10-23 21:41:00 +00:00
|
|
|
let g:ale_buffer_info = {}
|
2016-10-14 19:34:21 +00:00
|
|
|
AssertEqual [0, 0], ale#statusline#Count(bufnr('%'))
|
2016-10-13 13:50:57 +00:00
|
|
|
|
|
|
|
Execute (Count should read data from the cache):
|
2016-10-23 21:41:00 +00:00
|
|
|
let g:ale_buffer_info = {'44': {'count': [1, 2]}}
|
2016-10-14 19:34:21 +00:00
|
|
|
AssertEqual [1, 2], ale#statusline#Count(44)
|
2016-10-13 13:50:57 +00:00
|
|
|
|
2016-10-23 21:41:00 +00:00
|
|
|
Execute (The count should be correct after an update):
|
|
|
|
let g:ale_buffer_info = {'44': {}}
|
2016-10-13 13:50:57 +00:00
|
|
|
call ale#statusline#Update(44, [])
|
2016-10-14 19:34:21 +00:00
|
|
|
AssertEqual [0, 0], ale#statusline#Count(44)
|
2016-10-13 13:50:57 +00:00
|
|
|
|
|
|
|
Execute (Count should be match the loclist):
|
2016-10-24 19:21:32 +00:00
|
|
|
let g:ale_buffer_info = {
|
|
|
|
\ bufnr('%'): {
|
|
|
|
\ 'loclist': [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'bufnr': 1,
|
|
|
|
\ 'vcol': 0,
|
|
|
|
\ 'linter_name': 'testlinter',
|
|
|
|
\ 'nr': -1,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'col': 1,
|
|
|
|
\ 'text': 'Test Error',
|
|
|
|
\ },
|
|
|
|
\ ],
|
|
|
|
\ },
|
|
|
|
\}
|
2016-10-23 21:41:00 +00:00
|
|
|
AssertEqual [1, 0], ale#statusline#Count(bufnr('%'))
|
2016-10-13 13:50:57 +00:00
|
|
|
|
|
|
|
Execute (Output should be empty for non-existant buffer):
|
2016-10-14 19:34:21 +00:00
|
|
|
AssertEqual [0, 0], ale#statusline#Count(9001)
|
2016-10-13 13:50:57 +00:00
|
|
|
|
2016-10-23 21:41:00 +00:00
|
|
|
Execute (Statusline is formatted to the users preference for just errors):
|
|
|
|
let g:ale_buffer_info = {bufnr('%'): {}}
|
2016-10-13 13:50:57 +00:00
|
|
|
call ale#statusline#Update(bufnr('%'), [{'type': 'E'}, {'type': 'E'}])
|
2016-10-14 19:34:21 +00:00
|
|
|
AssertEqual '2E', ale#statusline#Status()
|
2016-10-13 13:50:57 +00:00
|
|
|
|
2016-10-23 21:41:00 +00:00
|
|
|
Execute (Statusline is formatted to the users preference for just warnings):
|
|
|
|
let g:ale_buffer_info = {bufnr('%'): {}}
|
2016-10-13 13:50:57 +00:00
|
|
|
call ale#statusline#Update(bufnr('%'), [{'type': 'W'}, {'type': 'W'}, {'type': 'W'}])
|
2016-10-14 19:34:21 +00:00
|
|
|
AssertEqual '3W', ale#statusline#Status()
|
2016-10-13 13:50:57 +00:00
|
|
|
|
2016-10-23 21:41:00 +00:00
|
|
|
Execute (Statusline is formatted to the users preference for errors and warnings):
|
|
|
|
let g:ale_buffer_info = {bufnr('%'): {}}
|
2016-10-13 13:50:57 +00:00
|
|
|
call ale#statusline#Update(bufnr('%'), [{'type': 'E'}, {'type': 'W'}, {'type': 'W'}])
|
2016-10-14 19:34:21 +00:00
|
|
|
AssertEqual '1E 2W', ale#statusline#Status()
|
2016-10-13 13:50:57 +00:00
|
|
|
|
2016-10-23 21:41:00 +00:00
|
|
|
Execute (Statusline is formatted to the users preference for no errors or warnings):
|
|
|
|
let g:ale_buffer_info = {bufnr('%'): {}}
|
2016-10-13 13:50:57 +00:00
|
|
|
call ale#statusline#Update(bufnr('%'), [])
|
2016-10-14 19:34:21 +00:00
|
|
|
AssertEqual 'OKIE', ale#statusline#Status()
|