mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
test: cherry-pick improvements from master branch
Partial cherry-pick of b3686b1597
.
* test/functional/provider: display reason from missing_provider
* provider#node#Detect: skip / handle non-existing node executable
This commit is contained in:

committed by
Justin M. Keyes

parent
1b2666cd21
commit
23a64c95d8
@@ -51,6 +51,9 @@ function! provider#node#Detect() abort
|
|||||||
if exists('g:node_host_prog')
|
if exists('g:node_host_prog')
|
||||||
return expand(g:node_host_prog)
|
return expand(g:node_host_prog)
|
||||||
endif
|
endif
|
||||||
|
if !executable('node')
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
if !s:is_minimum_version(v:null, 6, 0)
|
if !s:is_minimum_version(v:null, 6, 0)
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
|
@@ -8,8 +8,9 @@ local retry = helpers.retry
|
|||||||
|
|
||||||
do
|
do
|
||||||
clear()
|
clear()
|
||||||
if missing_provider('node') then
|
local reason = missing_provider('node')
|
||||||
pending("Missing nodejs host, or nodejs version is too old.", function()end)
|
if reason then
|
||||||
|
pending(string.format("Missing nodejs host, or nodejs version is too old (%s)", reason), function() end)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -10,13 +10,14 @@ local pcall_err = helpers.pcall_err
|
|||||||
|
|
||||||
do
|
do
|
||||||
clear()
|
clear()
|
||||||
if missing_provider('python3') then
|
local reason = missing_provider('python3')
|
||||||
|
if reason then
|
||||||
it(':python3 reports E319 if provider is missing', function()
|
it(':python3 reports E319 if provider is missing', function()
|
||||||
local expected = [[Vim%(py3.*%):E319: No "python3" provider found.*]]
|
local expected = [[Vim%(py3.*%):E319: No "python3" provider found.*]]
|
||||||
matches(expected, pcall_err(command, 'py3 print("foo")'))
|
matches(expected, pcall_err(command, 'py3 print("foo")'))
|
||||||
matches(expected, pcall_err(command, 'py3file foo'))
|
matches(expected, pcall_err(command, 'py3file foo'))
|
||||||
end)
|
end)
|
||||||
pending('Python 3 (or the pynvim module) is broken/missing', function() end)
|
pending(string.format('Python 3 (or the pynvim module) is broken/missing (%s)', reason), function() end)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -18,13 +18,14 @@ local pcall_err = helpers.pcall_err
|
|||||||
|
|
||||||
do
|
do
|
||||||
clear()
|
clear()
|
||||||
if missing_provider('python') then
|
local reason = missing_provider('python')
|
||||||
|
if reason then
|
||||||
it(':python reports E319 if provider is missing', function()
|
it(':python reports E319 if provider is missing', function()
|
||||||
local expected = [[Vim%(py.*%):E319: No "python" provider found.*]]
|
local expected = [[Vim%(py.*%):E319: No "python" provider found.*]]
|
||||||
matches(expected, pcall_err(command, 'py print("foo")'))
|
matches(expected, pcall_err(command, 'py print("foo")'))
|
||||||
matches(expected, pcall_err(command, 'pyfile foo'))
|
matches(expected, pcall_err(command, 'pyfile foo'))
|
||||||
end)
|
end)
|
||||||
pending('Python 2 (or the pynvim module) is broken/missing', function() end)
|
pending(string.format('Python 2 (or the pynvim module) is broken/missing (%s)', reason), function() end)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -18,13 +18,14 @@ local pcall_err = helpers.pcall_err
|
|||||||
|
|
||||||
do
|
do
|
||||||
clear()
|
clear()
|
||||||
if missing_provider('ruby') then
|
local reason = missing_provider('ruby')
|
||||||
|
if reason then
|
||||||
it(':ruby reports E319 if provider is missing', function()
|
it(':ruby reports E319 if provider is missing', function()
|
||||||
local expected = [[Vim%(ruby.*%):E319: No "ruby" provider found.*]]
|
local expected = [[Vim%(ruby.*%):E319: No "ruby" provider found.*]]
|
||||||
matches(expected, pcall_err(command, 'ruby puts "foo"'))
|
matches(expected, pcall_err(command, 'ruby puts "foo"'))
|
||||||
matches(expected, pcall_err(command, 'rubyfile foo'))
|
matches(expected, pcall_err(command, 'rubyfile foo'))
|
||||||
end)
|
end)
|
||||||
pending("Missing neovim RubyGem.", function() end)
|
pending(string.format('Missing neovim RubyGem (%s)', reason), function() end)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user