diff options
author | w0rp <devw0rp@gmail.com> | 2017-05-27 21:27:42 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-05-27 21:27:42 +0100 |
commit | aca5a00fb7b00655685a4306f1517d4e0f9126ee (patch) | |
tree | f41fac4c2166abaabeadb188c00c0de813f0e484 /test/test_linter_defintion_processing.vader | |
parent | 8e997ac2319efac06f7ca6b0912ca00a47ba26d1 (diff) | |
download | ale-aca5a00fb7b00655685a4306f1517d4e0f9126ee.zip |
Fix #500 - Support defining aliases for linter names
Diffstat (limited to 'test/test_linter_defintion_processing.vader')
-rw-r--r-- | test/test_linter_defintion_processing.vader | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/test_linter_defintion_processing.vader b/test/test_linter_defintion_processing.vader index 91667e01..09566557 100644 --- a/test/test_linter_defintion_processing.vader +++ b/test/test_linter_defintion_processing.vader @@ -323,3 +323,45 @@ Execute(PreProcess should set a default value for lint_file): \} AssertEqual 0, ale#linter#PreProcess(g:linter).lint_file + +Execute(PreProcess should set a default value for aliases): + let g:linter = { + \ 'name': 'x', + \ 'callback': 'x', + \ 'executable': 'x', + \ 'command': 'x', + \} + + AssertEqual [], ale#linter#PreProcess(g:linter).aliases + +Execute(PreProcess should complain about invalid `aliases` values): + let g:linter = { + \ 'name': 'x', + \ 'callback': 'x', + \ 'executable': 'x', + \ 'command': 'x', + \ 'aliases': 'foo', + \} + + AssertThrows call ale#linter#PreProcess(g:linter) + AssertEqual '`aliases` must be a List of String values', g:vader_exception + + let g:linter.aliases = [1] + + AssertThrows call ale#linter#PreProcess(g:linter) + AssertEqual '`aliases` must be a List of String values', g:vader_exception + +Execute(PreProcess should accept `aliases` lists): + let g:linter = { + \ 'name': 'x', + \ 'callback': 'x', + \ 'executable': 'x', + \ 'command': 'x', + \ 'aliases': [], + \} + + AssertEqual [], ale#linter#PreProcess(g:linter).aliases + + let g:linter.aliases = ['foo', 'bar'] + + AssertEqual ['foo', 'bar'], ale#linter#PreProcess(g:linter).aliases |