aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core/startup_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-11-02 18:11:14 +0100
committerGitHub <noreply@github.com>2020-11-02 18:11:14 +0100
commitbab5b2fbdae26b5ab898564c429b54f01bbd04b2 (patch)
tree02d5474819a8a09b8c473d5bb393065ca388cfa8 /test/functional/core/startup_spec.lua
parentdc14b1468afeb53c9ca0a734a2035cc54b5e1d94 (diff)
parentc60c7375f5754eea2a4209cc6441e70b2bb44f14 (diff)
downloadrneovim-bab5b2fbdae26b5ab898564c429b54f01bbd04b2.tar.gz
rneovim-bab5b2fbdae26b5ab898564c429b54f01bbd04b2.tar.bz2
rneovim-bab5b2fbdae26b5ab898564c429b54f01bbd04b2.zip
Merge pull request #13119 from bfredl/luartp
lua: handle require'package.mod' during startup
Diffstat (limited to 'test/functional/core/startup_spec.lua')
-rw-r--r--test/functional/core/startup_spec.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua
index 9b0668f9e6..3bfae5f3d7 100644
--- a/test/functional/core/startup_spec.lua
+++ b/test/functional/core/startup_spec.lua
@@ -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()