aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core/startup_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/core/startup_spec.lua')
-rw-r--r--test/functional/core/startup_spec.lua15
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)