diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-11-19 15:36:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-19 15:36:44 +0100 |
commit | ad56527247353df4a83fc7232d8680083ec4f24f (patch) | |
tree | dfbaad7525ebd9cb6e8ca9317efa2ce09d4e9a2a /test/functional/core/startup_spec.lua | |
parent | 569e5c86bfd7e7729229030fc2045c624e5f33c4 (diff) | |
parent | a119fe15da28b166ffef6bf34067e5a7f75bbca9 (diff) | |
download | rneovim-ad56527247353df4a83fc7232d8680083ec4f24f.tar.gz rneovim-ad56527247353df4a83fc7232d8680083ec4f24f.tar.bz2 rneovim-ad56527247353df4a83fc7232d8680083ec4f24f.zip |
Merge pull request #13319 from bfredl/bfredlpackages
startup: load files from the "start" directory of each entry in 'packpath' (as documented)
Diffstat (limited to 'test/functional/core/startup_spec.lua')
-rw-r--r-- | test/functional/core/startup_spec.lua | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 3bfae5f3d7..27793ab936 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -313,14 +313,33 @@ describe('startup', function() it("handles &packpath during startup", function() - pack_clear [[ let g:x = bar#test() ]] + pack_clear [[ + let g:x = bar#test() + let g:y = leftpad#pad("heyya") + ]] eq(-3, eval 'g:x') + eq(" heyya", eval 'g:y') - pack_clear [[ lua _G.y = require'bar'.doit() ]] - eq(9003, exec_lua [[ return _G.y ]]) + pack_clear [[ lua _G.y = require'bar'.doit() _G.z = require'leftpad''howdy' ]] + eq({9003, '\thowdy'}, exec_lua [[ return { _G.y, _G.z } ]]) end) it("handles :packadd during startup", function() + -- control group: opt/bonus is not availabe by default + pack_clear [[ + try + let g:x = bonus#secret() + catch + let g:err = v:exception + endtry + ]] + eq('Vim(let):E117: Unknown function: bonus#secret', eval 'g:err') + + pack_clear [[ lua _G.test = {pcall(function() require'bonus'.launch() end)} ]] + eq({false, [[[string ":lua"]:1: module 'bonus' not found:]]}, + exec_lua [[ _G.test[2] = string.gsub(_G.test[2], '[\r\n].*', '') return _G.test ]]) + + -- ok, time to launch the nukes: pack_clear [[ packadd! bonus | let g:x = bonus#secret() ]] eq('halloj', eval 'g:x') |