diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/command_callback/rust-rls-project/Cargo.toml | 0 | ||||
-rw-r--r-- | test/command_callback/test_rust_rls_callbacks.vader | 32 | ||||
-rw-r--r-- | test/test_engine_lsp_response_handling.vader | 12 |
3 files changed, 38 insertions, 6 deletions
diff --git a/test/command_callback/rust-rls-project/Cargo.toml b/test/command_callback/rust-rls-project/Cargo.toml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/command_callback/rust-rls-project/Cargo.toml diff --git a/test/command_callback/test_rust_rls_callbacks.vader b/test/command_callback/test_rust_rls_callbacks.vader new file mode 100644 index 00000000..76e69927 --- /dev/null +++ b/test/command_callback/test_rust_rls_callbacks.vader @@ -0,0 +1,32 @@ +Before: + Save g:ale_rust_rls_executable + + unlet! g:ale_rust_rls_executable + + runtime ale_linters/rust/rls.vim + + call ale#test#SetDirectory('/testplugin/test/command_callback') + +After: + Restore + + call ale#test#RestoreDirectory() + call ale#linter#Reset() + +Execute(The default executable path should be correct): + AssertEqual 'rls', ale_linters#rust#rls#GetExecutable(bufnr('')) + AssertEqual + \ ale#Escape('rls') . ' +nightly', + \ 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('')) + + call ale#test#SetFilename('rust-rls-project/test.rs') + + AssertEqual + \ g:dir . '/rust-rls-project', + \ ale_linters#rust#rls#GetProjectRoot(bufnr('')) diff --git a/test/test_engine_lsp_response_handling.vader b/test/test_engine_lsp_response_handling.vader index 1f766baf..b3a45b14 100644 --- a/test/test_engine_lsp_response_handling.vader +++ b/test/test_engine_lsp_response_handling.vader @@ -15,7 +15,7 @@ Execute(tsserver syntax error responses should be handled correctly): " When we get syntax errors and no semantic errors, we should keep the " syntax errors. - call ale#engine#HandleLSPResponse({ + call ale#engine#HandleLSPResponse(1, { \ 'seq': 0, \ 'type': 'event', \ 'event': 'syntaxDiag', @@ -37,7 +37,7 @@ Execute(tsserver syntax error responses should be handled correctly): \ ], \ }, \}) - call ale#engine#HandleLSPResponse({ + call ale#engine#HandleLSPResponse(1, { \ 'seq': 0, \ 'type': 'event', \ 'event': 'semanticDiag', @@ -65,7 +65,7 @@ Execute(tsserver syntax error responses should be handled correctly): \ getloclist(0) " After we get empty syntax errors, we should clear them. - call ale#engine#HandleLSPResponse({ + call ale#engine#HandleLSPResponse(1, { \ 'seq': 0, \ 'type': 'event', \ 'event': 'syntaxDiag', @@ -88,7 +88,7 @@ Execute(tsserver semantic error responses should be handled correctly): " When we get syntax errors and no semantic errors, we should keep the " syntax errors. - call ale#engine#HandleLSPResponse({ + call ale#engine#HandleLSPResponse(1, { \ 'seq': 0, \ 'type': 'event', \ 'event': 'syntaxDiag', @@ -98,7 +98,7 @@ Execute(tsserver semantic error responses should be handled correctly): \ ], \ }, \}) - call ale#engine#HandleLSPResponse({ + call ale#engine#HandleLSPResponse(1, { \ 'seq': 0, \ 'type': 'event', \ 'event': 'semanticDiag', @@ -138,7 +138,7 @@ Execute(tsserver semantic error responses should be handled correctly): \ getloclist(0) " After we get empty syntax errors, we should clear them. - call ale#engine#HandleLSPResponse({ + call ale#engine#HandleLSPResponse(1, { \ 'seq': 0, \ 'type': 'event', \ 'event': 'semanticDiag', |