summaryrefslogtreecommitdiff
path: root/test/test_statusline.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2016-10-23 22:41:00 +0100
committerw0rp <devw0rp@gmail.com>2016-10-23 22:41:00 +0100
commit7481facd7373dda4667c401695e6d8000ef52362 (patch)
tree11ebf0397b14aff2c9daab798aa6a323f2bde254 /test/test_statusline.vader
parent36461b69d7dbf0abe494cd450dd9233eed7b672f (diff)
downloadale-7481facd7373dda4667c401695e6d8000ef52362.zip
#107 Stop jobs when buffers close
Diffstat (limited to 'test/test_statusline.vader')
-rw-r--r--test/test_statusline.vader52
1 files changed, 31 insertions, 21 deletions
diff --git a/test/test_statusline.vader b/test/test_statusline.vader
index da4c693f..43245e97 100644
--- a/test/test_statusline.vader
+++ b/test/test_statusline.vader
@@ -1,49 +1,59 @@
Before:
let g:ale_buffer_loclist_map = {}
+ let g:ale_statusline_format = ['%sE', '%sW', 'OKIE']
+
+After:
+ let g:ale_buffer_loclist_map = {}
+ let g:ale_buffer_info = {}
Execute (Count should be 0 when data is empty):
+ let g:ale_buffer_info = {}
AssertEqual [0, 0], ale#statusline#Count(bufnr('%'))
-Before:
- let g:ale_buffer_count_map = {'44': [1, 2]}
-
Execute (Count should read data from the cache):
+ let g:ale_buffer_info = {'44': {'count': [1, 2]}}
AssertEqual [1, 2], ale#statusline#Count(44)
-Execute (Update the cache with new data):
+Execute (The count should be correct after an update):
+ let g:ale_buffer_info = {'44': {}}
call ale#statusline#Update(44, [])
-
-Then (The cache should reflect the new data):
AssertEqual [0, 0], ale#statusline#Count(44)
-Before:
- let g:ale_buffer_loclist_map = {'1': [{'lnum': 1, 'bufnr': 1, 'vcol': 0, 'linter_name': 'testlinter', 'nr': -1, 'type': 'E', 'col': 1, 'text': 'Test Error'}]}
-
Execute (Count should be match the loclist):
- AssertEqual [1, 0], ale#statusline#Count(1)
+ let g:ale_buffer_info = {bufnr('%'): {}}
+ let g:ale_buffer_loclist_map = {bufnr('%'): [
+ \ {
+ \ 'lnum': 1,
+ \ 'bufnr': 1,
+ \ 'vcol': 0,
+ \ 'linter_name': 'testlinter',
+ \ 'nr': -1,
+ \ 'type': 'E',
+ \ 'col': 1,
+ \ 'text': 'Test Error',
+ \ },
+ \]}
+ AssertEqual [1, 0], ale#statusline#Count(bufnr('%'))
Execute (Output should be empty for non-existant buffer):
AssertEqual [0, 0], ale#statusline#Count(9001)
-Before:
- let g:ale_statusline_format = ['%sE', '%sW', 'OKIE']
-
-Execute (Given some errors):
+Execute (Statusline is formatted to the users preference for just errors):
+ let g:ale_buffer_info = {bufnr('%'): {}}
call ale#statusline#Update(bufnr('%'), [{'type': 'E'}, {'type': 'E'}])
-Then (Statusline is formatted to the users preference):
AssertEqual '2E', ale#statusline#Status()
-Execute (Given some warnings):
+Execute (Statusline is formatted to the users preference for just warnings):
+ let g:ale_buffer_info = {bufnr('%'): {}}
call ale#statusline#Update(bufnr('%'), [{'type': 'W'}, {'type': 'W'}, {'type': 'W'}])
-Then (Statusline is formatted to the users preference):
AssertEqual '3W', ale#statusline#Status()
-Execute (Given some warnings, and errors):
+Execute (Statusline is formatted to the users preference for errors and warnings):
+ let g:ale_buffer_info = {bufnr('%'): {}}
call ale#statusline#Update(bufnr('%'), [{'type': 'E'}, {'type': 'W'}, {'type': 'W'}])
-Then (Statusline is formatted to the users preference):
AssertEqual '1E 2W', ale#statusline#Status()
-Execute (Given a lack of data):
+Execute (Statusline is formatted to the users preference for no errors or warnings):
+ let g:ale_buffer_info = {bufnr('%'): {}}
call ale#statusline#Update(bufnr('%'), [])
-Then (Statusline is formatted to the users preference):
AssertEqual 'OKIE', ale#statusline#Status()