diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/command_callback/test_haskell_hie_callbacks.vader | 27 | ||||
-rw-r--r-- | test/fixers/test_prettier_fixer_callback.vader | 14 | ||||
-rw-r--r-- | test/handler/test_gcc_handler.vader | 16 | ||||
-rw-r--r-- | test/test_engine_lsp_response_handling.vader | 6 |
4 files changed, 59 insertions, 4 deletions
diff --git a/test/command_callback/test_haskell_hie_callbacks.vader b/test/command_callback/test_haskell_hie_callbacks.vader new file mode 100644 index 00000000..5bd2794c --- /dev/null +++ b/test/command_callback/test_haskell_hie_callbacks.vader @@ -0,0 +1,27 @@ +Before: + call ale#assert#SetUpLinterTest('haskell', 'hie') + + Save &filetype + let &filetype = 'haskell' + +After: + call ale#assert#TearDownLinterTest() + +Execute(The language string should be correct): + AssertLSPLanguage 'haskell' + +Execute(The default executable should be correct): + AssertLinter 'hie', + \ ale#Escape('hie') . ' --lsp' + +Execute(The project root should be detected correctly): + AssertLSPProject g:dir + + call ale#test#SetFilename('hie_paths/file.hs') + + AssertLSPProject ale#path#Simplify(g:dir . '/hie_paths') + +Execute(The executable should be configurable): + let g:ale_haskell_hie_executable = 'foobar' + + AssertLinter 'foobar', ale#Escape('foobar') . ' --lsp' diff --git a/test/fixers/test_prettier_fixer_callback.vader b/test/fixers/test_prettier_fixer_callback.vader index 2018c3a6..130941d1 100644 --- a/test/fixers/test_prettier_fixer_callback.vader +++ b/test/fixers/test_prettier_fixer_callback.vader @@ -222,6 +222,20 @@ Execute(Should set --parser based on filetype, Vue): \ }, \ ale#fixers#prettier#ApplyFixForVersion(bufnr(''), ['1.6.0']) +Execute(Should set --parser based on filetype, YAML): + call ale#test#SetFilename('../prettier-test-files/testfile') + + set filetype=yaml + + AssertEqual + \ { + \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && ' + \ . ale#Escape(g:ale_javascript_prettier_executable) + \ . ' --parser yaml' + \ . ' --stdin-filepath %s --stdin', + \ }, + \ ale#fixers#prettier#ApplyFixForVersion(bufnr(''), ['1.6.0']) + Execute(Should set --parser based on first filetype of multiple filetypes): call ale#test#SetFilename('../prettier-test-files/testfile') diff --git a/test/handler/test_gcc_handler.vader b/test/handler/test_gcc_handler.vader index 43b38769..3daa9e60 100644 --- a/test/handler/test_gcc_handler.vader +++ b/test/handler/test_gcc_handler.vader @@ -174,6 +174,22 @@ Execute(The GCC handler should handle notes with no previous message): \ '<stdin>:1:1: note: x', \ ]) +Execute(The GCC handler should attach notes to previous messages): + AssertEqual + \ [ + \ { + \ 'lnum': 6, + \ 'col': 12, + \ 'type': 'E', + \ 'text': 'Some error', + \ 'detail': "Some error\n<stdin>:1:1: note: x", + \ }, + \ ], + \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [ + \ '-:6:12: error: Some error', + \ '<stdin>:1:1: note: x', + \ ]) + Execute(The GCC handler should interpret - as being the current file): AssertEqual \ [ diff --git a/test/test_engine_lsp_response_handling.vader b/test/test_engine_lsp_response_handling.vader index ddcd7b2e..818659db 100644 --- a/test/test_engine_lsp_response_handling.vader +++ b/test/test_engine_lsp_response_handling.vader @@ -62,9 +62,8 @@ Execute(tsserver syntax error responses should be handled correctly): \ 'col': 14, \ 'vcol': 0, \ 'nr': 1005, - \ 'code': '1005', \ 'type': 'E', - \ 'text': ''','' expected.', + \ 'text': '1005: '','' expected.', \ 'valid': 1, \ 'pattern': '', \ }, @@ -136,9 +135,8 @@ Execute(tsserver semantic error responses should be handled correctly): \ 'col': 14, \ 'vcol': 0, \ 'nr': 1005, - \ 'code': '1005', \ 'type': 'E', - \ 'text': 'Some semantic error', + \ 'text': '1005: Some semantic error', \ 'valid': 1, \ 'pattern': '', \ }, |