summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-04-27 22:52:11 +0100
committerw0rp <devw0rp@gmail.com>2018-04-27 22:52:11 +0100
commit6ab3fdc4d0566c09e9456c3bf1b7aa92747fd0aa (patch)
tree84362ca60df1e82d69e709e11688062d59c1ba79 /test
parentd1d705cc8484d935c0c18857f152027491df355e (diff)
downloadale-6ab3fdc4d0566c09e9456c3bf1b7aa92747fd0aa.zip
Close #1521 - Allow the language to be set with simple strings for LSP linters
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/test_php_langserver_callbacks.vader3
-rw-r--r--test/command_callback/test_rust_rls_callbacks.vader3
-rw-r--r--test/test_linter_defintion_processing.vader24
3 files changed, 24 insertions, 6 deletions
diff --git a/test/command_callback/test_php_langserver_callbacks.vader b/test/command_callback/test_php_langserver_callbacks.vader
index 0dc30630..ebcae0e7 100644
--- a/test/command_callback/test_php_langserver_callbacks.vader
+++ b/test/command_callback/test_php_langserver_callbacks.vader
@@ -42,9 +42,6 @@ Execute(Vendor executables should be detected):
\ )),
\ ale_linters#php#langserver#GetCommand(bufnr(''))
-Execute(The language string should be correct):
- AssertEqual 'php', ale_linters#php#langserver#GetLanguage(bufnr(''))
-
Execute(The project path should be correct for .git directories):
call ale#test#SetFilename('php-langserver-project/test.php')
call mkdir(g:dir . '/.git')
diff --git a/test/command_callback/test_rust_rls_callbacks.vader b/test/command_callback/test_rust_rls_callbacks.vader
index d537bccb..16bde98a 100644
--- a/test/command_callback/test_rust_rls_callbacks.vader
+++ b/test/command_callback/test_rust_rls_callbacks.vader
@@ -35,9 +35,6 @@ Execute(The toolchain should be ommitted if not given):
\ ale#Escape('rls'),
\ ale_linters#rust#rls#GetCommand(bufnr(''))
-Execute(The language string should be correct):
- AssertEqual 'rust', ale_linters#rust#rls#GetLanguage(bufnr(''))
-
Execute(The project root should be detected correctly):
AssertEqual '', ale_linters#rust#rls#GetProjectRoot(bufnr(''))
diff --git a/test/test_linter_defintion_processing.vader b/test/test_linter_defintion_processing.vader
index d946a600..653587b6 100644
--- a/test/test_linter_defintion_processing.vader
+++ b/test/test_linter_defintion_processing.vader
@@ -421,6 +421,30 @@ Execute(PreProcess should accept LSP server configurations):
AssertEqual 'socket', ale#linter#PreProcess(g:linter).lsp
+Execute(PreProcess should accept let you specify the language as just a string):
+ let g:linter = {
+ \ 'name': 'x',
+ \ 'lsp': 'socket',
+ \ 'address_callback': 'X',
+ \ 'language': 'foobar',
+ \ 'project_root_callback': 'x',
+ \}
+
+ AssertEqual 'foobar', ale#linter#PreProcess(g:linter).language_callback(0)
+
+Execute(PreProcess should complain about using language and language_callback together):
+ let g:linter = {
+ \ 'name': 'x',
+ \ 'lsp': 'socket',
+ \ 'address_callback': 'X',
+ \ 'language': 'x',
+ \ 'language_callback': 'x',
+ \ 'project_root_callback': 'x',
+ \}
+
+ AssertThrows call ale#linter#PreProcess(g:linter)
+ AssertEqual 'Only one of `language` or `language_callback` should be set', g:vader_exception
+
Execute(PreProcess should require an address_callback for LSP socket configurations):
let g:linter = {
\ 'name': 'x',