mirror of
https://github.com/neovim/neovim
synced 2025-07-18 18:21:46 +00:00
test(health): "test_plug/health/init.lua" completes as "test_plug"
(cherry picked from commit 7b680e0ca9
)
This commit is contained in:
@ -5,7 +5,7 @@ local Screen = require('test.functional.ui.screen')
|
|||||||
local clear = n.clear
|
local clear = n.clear
|
||||||
local curbuf_contents = n.curbuf_contents
|
local curbuf_contents = n.curbuf_contents
|
||||||
local command = n.command
|
local command = n.command
|
||||||
local eq, neq, matches = t.eq, t.neq, t.matches
|
local eq, matches = t.eq, t.matches
|
||||||
local getcompletion = n.fn.getcompletion
|
local getcompletion = n.fn.getcompletion
|
||||||
local insert = n.insert
|
local insert = n.insert
|
||||||
local exec_lua = n.exec_lua
|
local exec_lua = n.exec_lua
|
||||||
@ -40,12 +40,18 @@ describe(':checkhealth', function()
|
|||||||
matches('ERROR $VIM .* zub', curbuf_contents())
|
matches('ERROR $VIM .* zub', curbuf_contents())
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('completions can be listed via getcompletion()', function()
|
it('getcompletion()', function()
|
||||||
clear()
|
clear { args = { '-u', 'NORC', '+set runtimepath+=test/functional/fixtures' } }
|
||||||
eq('nvim', getcompletion('nvim', 'checkhealth')[1])
|
|
||||||
eq('provider.clipboard', getcompletion('prov', 'checkhealth')[1])
|
-- "test_plug/health/init.lua" should complete as "test_plug", not "test_plug.health". #30342
|
||||||
eq('vim.lsp', getcompletion('vim.ls', 'checkhealth')[1])
|
eq({
|
||||||
neq('vim', getcompletion('^vim', 'checkhealth')[1]) -- should not complete vim.health
|
'test_plug',
|
||||||
|
'test_plug.full_render',
|
||||||
|
'test_plug.submodule',
|
||||||
|
'test_plug.submodule_empty',
|
||||||
|
'test_plug.success1',
|
||||||
|
'test_plug.success2',
|
||||||
|
}, getcompletion('test_plug', 'checkhealth'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('completion checks for vim.health._complete() return type #28456', function()
|
it('completion checks for vim.health._complete() return type #28456', function()
|
||||||
@ -58,11 +64,9 @@ describe(':checkhealth', function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('health.vim', function()
|
describe('vim.health', function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear { args = { '-u', 'NORC' } }
|
clear { args = { '-u', 'NORC', '+set runtimepath+=test/functional/fixtures' } }
|
||||||
-- Provides healthcheck functions
|
|
||||||
command('set runtimepath+=test/functional/fixtures')
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe(':checkhealth', function()
|
describe(':checkhealth', function()
|
||||||
@ -208,9 +212,7 @@ end)
|
|||||||
|
|
||||||
describe(':checkhealth window', function()
|
describe(':checkhealth window', function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear { args = { '-u', 'NORC' } }
|
clear { args = { '-u', 'NORC', '+set runtimepath+=test/functional/fixtures' } }
|
||||||
-- Provides healthcheck functions
|
|
||||||
command('set runtimepath+=test/functional/fixtures')
|
|
||||||
command('set nofoldenable nowrap laststatus=0')
|
command('set nofoldenable nowrap laststatus=0')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user