aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-30 02:26:24 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-30 02:26:24 +0900
commite1ce15f714658b7f39e6f50c166cf2d0743a5727 (patch)
treed8de0845e07f18b0d1b3d1acbfc39aa371f45ea6 /test
parenta12bd9573bbb80d545937ffd386e94daef246204 (diff)
downloadvim-lsp-settings-e1ce15f714658b7f39e6f50c166cf2d0743a5727.tar.gz
vim-lsp-settings-e1ce15f714658b7f39e6f50c166cf2d0743a5727.tar.bz2
vim-lsp-settings-e1ce15f714658b7f39e6f50c166cf2d0743a5727.zip
Add test
Diffstat (limited to 'test')
-rw-r--r--test/lsp_settings.vimspec29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/lsp_settings.vimspec b/test/lsp_settings.vimspec
index cff06a7..30995f6 100644
--- a/test/lsp_settings.vimspec
+++ b/test/lsp_settings.vimspec
@@ -52,4 +52,33 @@ Describe lsp_settings
endtry
End
End
+
+ Describe lsp_settings#exec_path
+ It should return full-path to the command
+ if has('win32')
+ Assert Equals(empty(lsp_settings#exec_path('cmd')), 0)
+ else
+ Assert Equals(empty(lsp_settings#exec_path('sh')), 0)
+ endif
+ End
+
+ It should return 1 when command is executable in server/foo-bar/foo-bar
+ let l:servers_dir = lsp_settings#servers_dir()
+
+ try
+ call delete(l:servers_dir . '/foo-bar', 'rf')
+ call mkdir(l:servers_dir . '/foo-bar', 'p')
+ if has('win32')
+ call writefile(['@echo off', 'echo foo-bar'], l:servers_dir . '/foo-bar/foo-bar.cmd')
+ Assert Equals(lsp_settings#exec_path('foo-bar'), l:servers_dir . '\foo-bar\foo-bar.cmd')
+ else
+ call writefile(['#!/bin/sh', 'echo foo-bar'], l:servers_dir . '/foo-bar/foo-bar')
+ call setfperm(l:servers_dir . '/foo-bar/foo-bar', 'rwxr-xr-x')
+ Assert Equals(lsp_settings#exec_path('foo-bar'), l:servers_dir . '/foo-bar/foo-bar')
+ endif
+ finally
+ call delete(l:servers_dir . '/foo-bar', 'rf')
+ endtry
+ End
+ End
End