diff options
author | shadmansaleh <shadmansaleh3@gmail.com> | 2021-06-12 12:10:05 +0600 |
---|---|---|
committer | shadmansaleh <shadmansaleh3@gmail.com> | 2021-06-13 00:27:52 +0600 |
commit | 1f280b582f32c8ab7de41a34472fb856d5d2f7c4 (patch) | |
tree | b33909d0982ebd681800590c95d9b78987215794 /test/functional/core/startup_spec.lua | |
parent | d3bdde0bad12458128fae817aa348ac1d07b6f35 (diff) | |
download | rneovim-1f280b582f32c8ab7de41a34472fb856d5d2f7c4.tar.gz rneovim-1f280b582f32c8ab7de41a34472fb856d5d2f7c4.tar.bz2 rneovim-1f280b582f32c8ab7de41a34472fb856d5d2f7c4.zip |
fixup(runtime): Fix lua runtime files not listed
lua runtime files weren't listed in :scriptname & profiler.
This fixes that.
* Add tests
* Small doc tweeks
Diffstat (limited to 'test/functional/core/startup_spec.lua')
-rw-r--r-- | test/functional/core/startup_spec.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 30c0758446..658dfbda60 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -526,12 +526,25 @@ describe('runtime:', function() local plugin_folder_path = table.concat({plugin_path, 'plugin'}, pathsep) local plugin_file_path = table.concat({plugin_folder_path, 'plugin.lua'}, pathsep) + local profiler_file = 'test_startuptime.log' + mkdir_p(plugin_folder_path) write_file(plugin_file_path, [[vim.g.lua_plugin = 2]]) - clear{ args_rm={'-u'}, env={ XDG_CONFIG_HOME=xconfig }} + clear{ args_rm={'-u'}, args={'--startuptime', profiler_file}, env={ XDG_CONFIG_HOME=xconfig }} eq(2, eval('g:lua_plugin')) + -- Check if plugin_file_path is listed in :scriptname + local scripts = meths.exec(':scriptnames', true) + assert.Truthy(scripts:find(plugin_file_path)) + + -- Check if plugin_file_path is listed in startup profile + local profile_reader = io.open(profiler_file, 'r') + local profile_log = profile_reader:read('*a') + profile_reader:close() + assert.Truthy(profile_log :find(plugin_file_path)) + + os.remove(profiler_file) rmdir(plugin_path) end) |