mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
startup: handle autoload and lua packages during startup
¡NO HAY BANDA!
This commit is contained in:
@@ -7,6 +7,7 @@ local ok = helpers.ok
|
||||
local eq = helpers.eq
|
||||
local matches = helpers.matches
|
||||
local eval = helpers.eval
|
||||
local exec_lua = helpers.exec_lua
|
||||
local feed = helpers.feed
|
||||
local funcs = helpers.funcs
|
||||
local mkdir = helpers.mkdir
|
||||
@@ -305,6 +306,27 @@ describe('startup', function()
|
||||
'+q' })
|
||||
eq('[\'+q\'] 1', out)
|
||||
end)
|
||||
|
||||
local function pack_clear(cmd)
|
||||
clear('--cmd', 'set packpath=test/functional/fixtures', '--cmd', cmd)
|
||||
end
|
||||
|
||||
|
||||
it("handles &packpath during startup", function()
|
||||
pack_clear [[ let g:x = bar#test() ]]
|
||||
eq(-3, eval 'g:x')
|
||||
|
||||
pack_clear [[ lua _G.y = require'bar'.doit() ]]
|
||||
eq(9003, exec_lua [[ return _G.y ]])
|
||||
end)
|
||||
|
||||
it("handles :packadd during startup", function()
|
||||
pack_clear [[ packadd! bonus | let g:x = bonus#secret() ]]
|
||||
eq('halloj', eval 'g:x')
|
||||
|
||||
pack_clear [[ packadd! bonus | lua _G.y = require'bonus'.launch() ]]
|
||||
eq('CPE 1704 TKS', exec_lua [[ return _G.y ]])
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('sysinit', function()
|
||||
|
Reference in New Issue
Block a user