diff options
author | w0rp <devw0rp@gmail.com> | 2017-08-01 00:42:22 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-08-01 00:42:22 +0100 |
commit | 35913d9ce7c9679c1242ffdf14bfa1126c999e7e (patch) | |
tree | 87913c5e072ac1404c271e305e1e376d92b8ef48 /test | |
parent | a4ffd2f37c5d535d62170f7e3021cd2981689988 (diff) | |
download | ale-35913d9ce7c9679c1242ffdf14bfa1126c999e7e.zip |
Cover the SaveEvent function with a test
Diffstat (limited to 'test')
-rw-r--r-- | test/test_lint_file_linters.vader | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/test_lint_file_linters.vader b/test/test_lint_file_linters.vader index a82db727..4110c059 100644 --- a/test/test_lint_file_linters.vader +++ b/test/test_lint_file_linters.vader @@ -224,3 +224,30 @@ Execute(Linter errors from files should be kept when no other linters are run): \ 'type': 'E', \ }, \], GetSimplerLoclist() + +Execute(The Save event should respect the buffer number): + let g:ale_linters = {'foobar': ['lint_file_linter']} + Assert filereadable(expand('%:p')), 'The file was not readable' + + call ale#events#SaveEvent(bufnr('') + 1) + + " We shouldn't get any prblems yet. + AssertEqual [], GetSimplerLoclist() + + call ale#events#SaveEvent(bufnr('')) + + " We should get them now we used the right buffer number. + AssertEqual [ + \ { + \ 'lnum': 1, + \ 'col': 3, + \ 'text': 'file warning', + \ 'type': 'W', + \ }, + \ { + \ 'lnum': 2, + \ 'col': 3, + \ 'text': 'file error', + \ 'type': 'E', + \ }, + \], GetSimplerLoclist() |