diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-01-30 01:33:17 +0900 |
---|---|---|
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-01-30 01:33:17 +0900 |
commit | ef182997b0e6793cc2517cc9fed0fe15c0ea5df0 (patch) | |
tree | 7f5fe08c81661ed8e5297d072f753fb17e99751b /test | |
parent | 3fa9d50e0e3cf5c4b34eef7ce9ea20a52d82e572 (diff) | |
download | vim-lsp-settings-ef182997b0e6793cc2517cc9fed0fe15c0ea5df0.tar.gz vim-lsp-settings-ef182997b0e6793cc2517cc9fed0fe15c0ea5df0.tar.bz2 vim-lsp-settings-ef182997b0e6793cc2517cc9fed0fe15c0ea5df0.zip |
Add test
Diffstat (limited to 'test')
-rw-r--r-- | test/lsp_settings.vimspec | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/lsp_settings.vimspec b/test/lsp_settings.vimspec index 743f951..3b34941 100644 --- a/test/lsp_settings.vimspec +++ b/test/lsp_settings.vimspec @@ -11,4 +11,28 @@ Describe lsp_settings Assert Equals(lsp_settings#get('pyls', 'cmd', {key, name-> 'good'}), 'good') End End + + Describe lsp_settings#executable + It should return command is executable in $PATH + if has('win32') + Assert Equals(lsp_settings#executable('cmd'), 1) + else + Assert Equals(lsp_settings#executable('sh'), 1) + endif + Assert Equals(lsp_settings#executable('unknown-command'), 0) + End + + It should return command is executable in server/foo-bar/foo-bar + let l:servers_dir = fnamemodify(expand('<sfile>:h:h').'/servers', ':p') + + try + call delete(l:servers_dir . '/foo-bar', 'rf') + call mkdir(l:servers_dir . '/foo-bar') + call writefile(['echo foo-bar'], l:servers_dir . '/foo-bar/foo-bar.cmd') + Assert Equals(lsp_settings#executable('foo-bar'), 1) + finally + call delete(l:servers_dir . '/foo-bar', 'rf') + endtry + End + End End |