aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/packadd_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/legacy/packadd_spec.lua')
-rw-r--r--test/functional/legacy/packadd_spec.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua
index e84a8e60d6..5006981f8f 100644
--- a/test/functional/legacy/packadd_spec.lua
+++ b/test/functional/legacy/packadd_spec.lua
@@ -73,6 +73,23 @@ describe('packadd', function()
packadd! mytest
call assert_equal(new_rtp, &rtp)
endfunc
+
+ func Test_packloadall()
+ let plugindir = &packpath . '/pack/mine/start/foo/plugin'
+ call mkdir(plugindir, 'p')
+ call writefile(['let g:plugin_foo_number = 1234'], plugindir . '/bar.vim')
+ packloadall
+ call assert_equal(1234, g:plugin_foo_number)
+
+ " only works once
+ call writefile(['let g:plugin_bar_number = 4321'], plugindir . '/bar2.vim')
+ packloadall
+ call assert_false(exists('g:plugin_bar_number'))
+
+ " works when ! used
+ packloadall!
+ call assert_equal(4321, g:plugin_bar_number)
+ endfunc
]=])
call('SetUp')
end)
@@ -91,6 +108,11 @@ describe('packadd', function()
expected_empty()
end)
+ it('works with :packloadall', function()
+ call('Test_packloadall')
+ expected_empty()
+ end)
+
describe('command line completion', function()
local Screen = require('test.functional.ui.screen')
local screen