diff options
Diffstat (limited to 'test/test_virtualtext.vader')
-rw-r--r-- | test/test_virtualtext.vader | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/test/test_virtualtext.vader b/test/test_virtualtext.vader index 25965f50..da58c9f0 100644 --- a/test/test_virtualtext.vader +++ b/test/test_virtualtext.vader @@ -37,6 +37,27 @@ Before: \ 'col': 5, \ 'text': 'Line 2 warning 2', \ }, + \ { + \ 'bufnr': bufnr(''), + \ 'type': 'W', + \ 'lnum': 3, + \ 'col': 3, + \ 'text': 'Line 3 warning 1', + \ }, + \ { + \ 'bufnr': bufnr(''), + \ 'type': 'E', + \ 'lnum': 3, + \ 'col': 5, + \ 'text': 'Line 3 error 1', + \ }, + \ { + \ 'bufnr': bufnr(''), + \ 'type': 'E', + \ 'lnum': 3, + \ 'col': 6, + \ 'text': 'Line 3 error 2', + \ }, \ ], \ }, \} @@ -79,6 +100,7 @@ Execute(Comment text should be detected correctly for HTML files): Given python(An example Python file): # line 1 # line 2 + # line 3 Execute(We should not show virtualtext when disabled): if has('patch-9.0.0297') || has('nvim-0.8.0') @@ -157,11 +179,11 @@ Execute(We should be able to change the virtualtext prefix per-buffer): AssertEqual 'B> Line 1 error', ale#virtualtext#GetLastMessageForTests() endif -Execute(We should set errors across all lines): +Execute(We should be able to set messages across all lines): if has('patch-9.0.0297') || has('nvim-0.8.0') call ale#virtualtext#SetTexts(bufnr(''), g:ale_buffer_info[bufnr('')].loclist) - AssertEqual '# W: Line 2 warning 2', ale#virtualtext#GetLastMessageForTests() + AssertEqual '# E: Line 3 error 2', ale#virtualtext#GetLastMessageForTests() if has('patch-9.0.0297') AssertEqual ['ALEVirtualTextError'], map(prop_list(1), {_, v -> v.type}) @@ -176,12 +198,12 @@ Execute(We should be able to limit virtual messages to the first one only): if has('patch-9.0.0297') || has('nvim-0.8.0') call ale#virtualtext#SetTexts(bufnr(''), g:ale_buffer_info[bufnr('')].loclist) - AssertEqual '# W: Line 2 warning 1', ale#virtualtext#GetLastMessageForTests() + AssertEqual '# E: Line 3 error 1', ale#virtualtext#GetLastMessageForTests() if has('patch-9.0.0297') AssertEqual ['ALEVirtualTextError'], map(prop_list(1), {_, v -> v.type}) - AssertEqual ['ALEVirtualTextWarning'], - \ map(prop_list(2), {_, v -> v.type}) + AssertEqual ['ALEVirtualTextWarning'], map(prop_list(2), {_, v -> v.type}) + AssertEqual ['ALEVirtualTextError'], map(prop_list(3), {_, v -> v.type}) endif endif |