All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 " Author: Jeffrey Lau https://github.com/zoonfafer
2 " Description: Tests for the Vim vimls linter
5 call ale#assert#SetUpLinterTest('vim', 'vimls')
8 if isdirectory(g:dir . '/.git')
9 call delete(g:dir . '/.git', 'd')
12 call ale#assert#TearDownLinterTest()
14 Execute(should set correct defaults):
15 AssertLinter 'vim-language-server', ale#Escape('vim-language-server') . ' --stdio'
17 Execute(should set correct LSP values):
18 call ale#test#SetFilename('../test-files/vim/path_with_autoload/test.vim')
19 AssertLSPLanguage 'vim'
22 AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/vim/path_with_autoload')
24 Execute(should set correct project for .git/):
25 let b:parent_dir = ale#path#Simplify(g:dir . '/..')
26 let b:git_dir = b:parent_dir . '/.git'
28 call ale#test#SetFilename('../test-files/vim/test.vim')
30 if !isdirectory(b:git_dir)
34 AssertLSPProject ale#path#Simplify(b:parent_dir)
36 call delete(b:git_dir, 'd')
39 Execute(should set correct project for plugin/):
40 call ale#test#SetFilename('../test-files/vim/path_with_plugin/test.vim')
42 AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/vim/path_with_plugin')
44 Execute(should accept configuration settings):
47 let b:ale_vim_vimls_config = {'vim': {'foobar': v:true}}
48 AssertLSPConfig {'vim': {'foobar': v:true}}
50 Execute(should set correct project for .vimrc):
51 call ale#test#SetFilename('../test-files/vim/path_with_vimrc/.vimrc')
53 AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/vim/path_with_vimrc')
55 Execute(should set correct project for init.vim):
56 call ale#test#SetFilename('../test-files/vim/path_with_initvim/init.vim')
58 AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/vim/path_with_initvim')
60 Execute(should use the local executable when available):
61 call ale#test#SetFilename('../test-files/vim/file.vim')
63 AssertLinter ale#path#Simplify(g:dir . '/../test-files/vim/node_modules/.bin/vim-language-server'),
64 \ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/vim/node_modules/.bin/vim-language-server')) . ' --stdio'
66 Execute(should let the global executable to be used):
67 let g:ale_vim_vimls_use_global = 1
68 call ale#test#SetFilename('../test-files/vim/file.vim')
70 AssertLinter 'vim-language-server',
71 \ ale#Escape('vim-language-server') . ' --stdio'
73 Execute(should allow the executable to be configured):
74 let g:ale_vim_vimls_executable = 'foobar'
75 call ale#test#SetFilename('../test-files/dummy')
77 AssertLinter 'foobar', ale#Escape('foobar') . ' --stdio'