diff options
author | w0rp <devw0rp@gmail.com> | 2017-05-20 23:32:41 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-05-20 23:32:41 +0100 |
commit | f92bbab8cf22becfaf3188474afb10245b489843 (patch) | |
tree | 95abe059624aee88ca4ba7096fa07e88d2617f86 /test | |
parent | bf8bf0668113a1c5a378f05050722967f88a273f (diff) | |
download | ale-f92bbab8cf22becfaf3188474afb10245b489843.zip |
#149 - Support Info, style error, and style warning types for problems for signs
Diffstat (limited to 'test')
-rw-r--r-- | test/sign/test_sign_placement.vader | 32 | ||||
-rw-r--r-- | test/test_loclist_corrections.vader | 21 |
2 files changed, 53 insertions, 0 deletions
diff --git a/test/sign/test_sign_placement.vader b/test/sign/test_sign_placement.vader index 707e2ce4..f8e926b6 100644 --- a/test/sign/test_sign_placement.vader +++ b/test/sign/test_sign_placement.vader @@ -71,6 +71,38 @@ After: call ale#linter#Reset() sign unplace * +Execute(ale#sign#GetSignType should return the right sign types): + AssertEqual 'ALEErrorSign', ale#sign#GetSignType([{'type': 'E'}]) + AssertEqual 'ALEStyleErrorSign', ale#sign#GetSignType([{'type': 'E', 'sub_type': 'style'}]) + AssertEqual 'ALEWarningSign', ale#sign#GetSignType([{'type': 'W'}]) + AssertEqual 'ALEStyleWarningSign', ale#sign#GetSignType([{'type': 'W', 'sub_type': 'style'}]) + AssertEqual 'ALEInfoSign', ale#sign#GetSignType([{'type': 'I'}]) + AssertEqual 'ALEErrorSign', ale#sign#GetSignType([ + \ {'type': 'E'}, + \ {'type': 'W'}, + \ {'type': 'I'}, + \ {'type': 'E', 'sub_type': 'style'}, + \ {'type': 'W', 'sub_type': 'style'}, + \]) + AssertEqual 'ALEWarningSign', ale#sign#GetSignType([ + \ {'type': 'W'}, + \ {'type': 'I'}, + \ {'type': 'E', 'sub_type': 'style'}, + \ {'type': 'W', 'sub_type': 'style'}, + \]) + AssertEqual 'ALEInfoSign', ale#sign#GetSignType([ + \ {'type': 'I'}, + \ {'type': 'E', 'sub_type': 'style'}, + \ {'type': 'W', 'sub_type': 'style'}, + \]) + AssertEqual 'ALEStyleErrorSign', ale#sign#GetSignType([ + \ {'type': 'E', 'sub_type': 'style'}, + \ {'type': 'W', 'sub_type': 'style'}, + \]) + AssertEqual 'ALEStyleWarningSign', ale#sign#GetSignType([ + \ {'type': 'W', 'sub_type': 'style'}, + \]) + Given testft(A file with warnings/errors): foo bar diff --git a/test/test_loclist_corrections.vader b/test/test_loclist_corrections.vader index 8e01dfbc..f424424d 100644 --- a/test/test_loclist_corrections.vader +++ b/test/test_loclist_corrections.vader @@ -164,3 +164,24 @@ Execute(FixLocList should pass on col_length values): \ {'text': 'a', 'lnum': '010', 'col': '011', 'end_col': 12}, \ ], \ ) + +Execute(FixLocList should allow subtypes to be set): + AssertEqual + \ [ + \ { + \ 'text': 'a', + \ 'lnum': 10, + \ 'col': 0, + \ 'bufnr': bufnr('%'), + \ 'vcol': 0, + \ 'type': 'E', + \ 'sub_type': 'style', + \ 'nr': -1, + \ 'linter_name': 'foobar', + \ }, + \], + \ ale#engine#FixLocList( + \ bufnr('%'), + \ {'name': 'foobar'}, + \ [{'text': 'a', 'lnum': 11, 'sub_type': 'style'}], + \ ) |