summaryrefslogtreecommitdiff
path: root/test/test_linter_defintion_processing.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-07-02 13:17:24 +0100
committerw0rp <devw0rp@gmail.com>2017-07-02 13:17:24 +0100
commit857ca941d214a65b2168429bcd3b12df26f13a67 (patch)
treec50ee0783783dade90e7cfa6a8ba6945ff1b116c /test/test_linter_defintion_processing.vader
parentb731bd77abca29064600c01ad8df7d7d1033fc7a (diff)
downloadale-857ca941d214a65b2168429bcd3b12df26f13a67.zip
Support an 'stdio' type for linter defintions, and require a command for LSP connections via programs
Diffstat (limited to 'test/test_linter_defintion_processing.vader')
-rw-r--r--test/test_linter_defintion_processing.vader39
1 files changed, 21 insertions, 18 deletions
diff --git a/test/test_linter_defintion_processing.vader b/test/test_linter_defintion_processing.vader
index 9c880c20..7ff8ddbf 100644
--- a/test/test_linter_defintion_processing.vader
+++ b/test/test_linter_defintion_processing.vader
@@ -370,6 +370,7 @@ Execute(PreProcess should accept tsserver LSP configuration):
let g:linter = {
\ 'name': 'x',
\ 'executable': 'x',
+ \ 'command': 'x',
\ 'lsp': 'tsserver',
\ 'callback': 'x',
\}
@@ -379,46 +380,48 @@ Execute(PreProcess should accept tsserver LSP configuration):
call remove(g:linter, 'executable')
let g:linter.executable_callback = 'X'
- call ale#linter#PreProcess(g:linter).lsp
+ call ale#linter#PreProcess(g:linter)
+
+ call remove(g:linter, 'command')
+ let g:linter.command_callback = 'X'
+
+ call ale#linter#PreProcess(g:linter)
-Execute(PreProcess should complain about commands being set for LSP configurations):
+Execute(PreProcess should accept stdio LSP configuration):
let g:linter = {
\ 'name': 'x',
\ 'executable': 'x',
- \ 'lsp': 'tsserver',
\ 'command': 'x',
+ \ 'lsp': 'stdio',
\ 'callback': 'x',
\}
- AssertThrows call ale#linter#PreProcess(g:linter)
- AssertEqual '`command` and `command_callback` and `command_chain` cannot be used when `lsp` is set', g:vader_exception
+ AssertEqual 'stdio', ale#linter#PreProcess(g:linter).lsp
- call remove(g:linter, 'command')
- let g:linter.command_callback = 'X'
+ call remove(g:linter, 'executable')
+ let g:linter.executable_callback = 'X'
- AssertThrows call ale#linter#PreProcess(g:linter)
- AssertEqual '`command` and `command_callback` and `command_chain` cannot be used when `lsp` is set', g:vader_exception
+ call ale#linter#PreProcess(g:linter)
- call remove(g:linter, 'command_callback')
- let g:linter.command_chain = []
+ call remove(g:linter, 'command')
+ let g:linter.command_callback = 'X'
- AssertThrows call ale#linter#PreProcess(g:linter)
- AssertEqual '`command` and `command_callback` and `command_chain` cannot be used when `lsp` is set', g:vader_exception
+ call ale#linter#PreProcess(g:linter)
Execute(PreProcess should accept LSP server configurations):
let g:linter = {
\ 'name': 'x',
- \ 'lsp': 'lsp',
+ \ 'lsp': 'socket',
\ 'callback': 'x',
\ 'address_callback': 'X',
\}
- AssertEqual 'lsp', ale#linter#PreProcess(g:linter).lsp
+ AssertEqual 'socket', ale#linter#PreProcess(g:linter).lsp
-Execute(PreProcess should require an address_callback for LSP server configurations):
+Execute(PreProcess should require an address_callback for LSP socket configurations):
let g:linter = {
\ 'name': 'x',
- \ 'lsp': 'lsp',
+ \ 'lsp': 'socket',
\ 'callback': 'x',
\}
@@ -435,4 +438,4 @@ Execute(PreProcess should complain about address_callback for non-LSP linters):
\}
AssertThrows call ale#linter#PreProcess(g:linter)
- AssertEqual '`address_callback` cannot be used when lsp != ''lsp''', g:vader_exception
+ AssertEqual '`address_callback` cannot be used when lsp != ''socket''', g:vader_exception