diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lsp/test_lsp_client_messages.vader | 3 | ||||
-rw-r--r-- | test/test_linter_defintion_processing.vader | 25 |
2 files changed, 27 insertions, 1 deletions
diff --git a/test/lsp/test_lsp_client_messages.vader b/test/lsp/test_lsp_client_messages.vader index 89a29c8f..e7eda33a 100644 --- a/test/lsp/test_lsp_client_messages.vader +++ b/test/lsp/test_lsp_client_messages.vader @@ -16,9 +16,10 @@ Execute(ale#lsp#message#Initialize() should return correct messages): \ 'processId': getpid(), \ 'rootPath': '/foo/bar', \ 'capabilities': {}, + \ 'initializationOptions': {'foo': 'bar'}, \ } \ ], - \ ale#lsp#message#Initialize('/foo/bar') + \ ale#lsp#message#Initialize('/foo/bar', {'foo': 'bar'}) Execute(ale#lsp#message#Initialized() should return correct messages): AssertEqual [1, 'initialized'], ale#lsp#message#Initialized() diff --git a/test/test_linter_defintion_processing.vader b/test/test_linter_defintion_processing.vader index 653587b6..48a4a394 100644 --- a/test/test_linter_defintion_processing.vader +++ b/test/test_linter_defintion_processing.vader @@ -465,3 +465,28 @@ 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 != ''socket''', g:vader_exception + +Execute(PreProcess should complain about using initialization_options and initialization_options_callback together): + let g:linter = { + \ 'name': 'x', + \ 'lsp': 'socket', + \ 'address_callback': 'X', + \ 'language': 'x', + \ 'project_root_callback': 'x', + \ 'initialization_options': 'x', + \ 'initialization_options_callback': 'x', + \} + + AssertThrows call ale#linter#PreProcess(g:linter) + AssertEqual 'Only one of `initialization_options` or `initialization_options_callback` should be set', g:vader_exception + +Execute (PreProcess should throw when initialization_options_callback is not a callback): + AssertThrows call ale#linter#PreProcess({ + \ 'name': 'foo', + \ 'lsp': 'socket', + \ 'address_callback': 'X', + \ 'language': 'x', + \ 'project_root_callback': 'x', + \ 'initialization_options_callback': {}, + \}) + AssertEqual '`initialization_options_callback` must be a callback if defined', g:vader_exception |