aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/vimscript')
-rw-r--r--test/functional/vimscript/executable_spec.lua6
-rw-r--r--test/functional/vimscript/exepath_spec.lua3
-rw-r--r--test/functional/vimscript/has_spec.lua7
-rw-r--r--test/functional/vimscript/null_spec.lua2
4 files changed, 14 insertions, 4 deletions
diff --git a/test/functional/vimscript/executable_spec.lua b/test/functional/vimscript/executable_spec.lua
index 28aefb72e5..048a65188d 100644
--- a/test/functional/vimscript/executable_spec.lua
+++ b/test/functional/vimscript/executable_spec.lua
@@ -18,7 +18,7 @@ describe('executable()', function()
end)
it('fails for invalid values', function()
- for _, input in ipairs({'""', 'v:null', 'v:true', 'v:false', '{}', '[]'}) do
+ for _, input in ipairs({'v:null', 'v:true', 'v:false', '{}', '[]'}) do
eq('Vim(call):E928: String required', exc_exec('call executable('..input..')'))
end
command('let $PATH = fnamemodify("./test/functional/fixtures/bin", ":p")')
@@ -27,6 +27,10 @@ describe('executable()', function()
end
end)
+ it('returns 0 for empty strings', function()
+ eq(0, call('executable', '""'))
+ end)
+
it('returns 0 for non-existent files', function()
eq(0, call('executable', 'no_such_file_exists_209ufq23f'))
end)
diff --git a/test/functional/vimscript/exepath_spec.lua b/test/functional/vimscript/exepath_spec.lua
index 08d2c59af8..bbca954511 100644
--- a/test/functional/vimscript/exepath_spec.lua
+++ b/test/functional/vimscript/exepath_spec.lua
@@ -20,9 +20,10 @@ describe('exepath()', function()
end)
it('fails for invalid values', function()
- for _, input in ipairs({'""', 'v:null', 'v:true', 'v:false', '{}', '[]'}) do
+ for _, input in ipairs({'v:null', 'v:true', 'v:false', '{}', '[]'}) do
eq('Vim(call):E928: String required', exc_exec('call exepath('..input..')'))
end
+ eq('Vim(call):E1142: Non-empty string required', exc_exec('call exepath("")'))
command('let $PATH = fnamemodify("./test/functional/fixtures/bin", ":p")')
for _, input in ipairs({'v:null', 'v:true', 'v:false'}) do
eq('Vim(call):E928: String required', exc_exec('call exepath('..input..')'))
diff --git a/test/functional/vimscript/has_spec.lua b/test/functional/vimscript/has_spec.lua
index a3af2d1a20..c03fd13e0c 100644
--- a/test/functional/vimscript/has_spec.lua
+++ b/test/functional/vimscript/has_spec.lua
@@ -59,7 +59,12 @@ describe('has()', function()
end)
it('"wsl"', function()
- if 1 == funcs.has('win32') or 1 == funcs.has('mac') then
+ local luv = require('luv')
+ local is_wsl =
+ luv.os_uname()['release']:lower():match('microsoft') and true or false
+ if is_wsl then
+ eq(1, funcs.has('wsl'))
+ else
eq(0, funcs.has('wsl'))
end
end)
diff --git a/test/functional/vimscript/null_spec.lua b/test/functional/vimscript/null_spec.lua
index 7ecbcd2fd6..f23f00bcc5 100644
--- a/test/functional/vimscript/null_spec.lua
+++ b/test/functional/vimscript/null_spec.lua
@@ -161,7 +161,7 @@ describe('NULL', function()
null_test('does not crash :echomsg', 'echomsg S', 0)
null_test('does not crash :execute', 'execute S', 0)
null_expr_test('does not crash execute()', 'execute(S)', 0, '')
- null_expr_test('makes executable() error out', 'executable(S)', 'E928: String required', 0)
+ null_expr_test('does not crash executable()', 'executable(S)', 0, 0)
null_expr_test('makes timer_start() error out', 'timer_start(0, S)', 'E921: Invalid callback argument', -1)
null_expr_test('does not crash filereadable()', 'filereadable(S)', 0, 0)
null_expr_test('does not crash filewritable()', 'filewritable(S)', 0, 0)