summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-08-22 22:45:55 +0100
committerw0rp <devw0rp@gmail.com>2017-08-22 22:45:55 +0100
commit0507503aa755587892e8841a749dc0ca8641a6f8 (patch)
tree0718c0683698ee38671c714dfb540105d194d314 /test
parent80c7fbcefeca7beb80bb761447049ea0ca2a99be (diff)
downloadale-0507503aa755587892e8841a749dc0ca8641a6f8.zip
#653 Set loclists better when taking data from previous buffers
Diffstat (limited to 'test')
-rw-r--r--test/test_setting_problems_found_in_previous_buffers.vader54
1 files changed, 46 insertions, 8 deletions
diff --git a/test/test_setting_problems_found_in_previous_buffers.vader b/test/test_setting_problems_found_in_previous_buffers.vader
index 262b9d18..45dfa662 100644
--- a/test/test_setting_problems_found_in_previous_buffers.vader
+++ b/test/test_setting_problems_found_in_previous_buffers.vader
@@ -1,6 +1,9 @@
Before:
Save g:ale_buffer_info
Save &filetype
+ Save g:ale_set_lists_synchronously
+
+ let g:ale_set_lists_synchronously = 1
" Set up items in other buffers which should set in this one.
let g:ale_buffer_info = {}
@@ -13,7 +16,7 @@ Before:
\ ])
call ale#engine#InitBufferInfo(bufnr('') + 2)
let g:ale_buffer_info[bufnr('') + 2].loclist =
- \ ale#engine#FixLocList(bufnr('') + 2, 'linter_two', [
+ \ ale#engine#FixLocList(bufnr('') + 2, 'linter_one', [
\ {'lnum': 1, 'filename': expand('%:p'), 'text': 'foo'},
\ {'lnum': 3, 'filename': expand('%:p'), 'text': 'baz'},
\ {'lnum': 5, 'text': 'ignore this one'},
@@ -23,15 +26,9 @@ Before:
\ 'name': 'linter_one',
\ 'callback': 'WhoCares',
\ 'executable': 'echo',
- \ 'command': 'echo',
+ \ 'command': 'sleep 1000',
\ 'lint_file': 1,
\})
- call ale#linter#Define('foobar', {
- \ 'name': 'linter_two',
- \ 'callback': 'WhoCares',
- \ 'executable': 'echo',
- \ 'command': 'echo',
- \})
After:
call ale#engine#Cleanup(bufnr(''))
@@ -53,6 +50,47 @@ Execute(Problems found from previously opened buffers should be set when linting
AssertEqual
\ [
+ \ {
+ \ 'lnum': 1,
+ \ 'bufnr': bufnr(''),
+ \ 'col': 0,
+ \ 'filename': expand('%:p'),
+ \ 'linter_name': 'linter_one',
+ \ 'nr': -1,
+ \ 'type': 'E',
+ \ 'vcol': 0,
+ \ 'text': 'foo',
+ \ 'sign_id': 1000001,
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'bufnr': bufnr(''),
+ \ 'col': 0,
+ \ 'filename': expand('%:p'),
+ \ 'linter_name': 'linter_one',
+ \ 'nr': -1,
+ \ 'type': 'E',
+ \ 'vcol': 0,
+ \ 'text': 'bar',
+ \ 'sign_id': 1000002,
+ \ },
+ \ {
+ \ 'lnum': 3,
+ \ 'bufnr': bufnr(''),
+ \ 'col': 0,
+ \ 'filename': expand('%:p'),
+ \ 'linter_name': 'linter_one',
+ \ 'nr': -1,
+ \ 'type': 'E',
+ \ 'vcol': 0,
+ \ 'text': 'baz',
+ \ 'sign_id': 1000003,
+ \ },
+ \ ],
+ \ g:ale_buffer_info[bufnr('')].loclist
+
+ AssertEqual
+ \ [
\ {'lnum': 1, 'bufnr': bufnr(''), 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'E', 'pattern': '', 'text': 'foo'},
\ {'lnum': 2, 'bufnr': bufnr(''), 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'E', 'pattern': '', 'text': 'bar'},
\ {'lnum': 3, 'bufnr': bufnr(''), 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': 'E', 'pattern': '', 'text': 'baz'},