mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
Merge #19267 require() in --startuptime
This commit is contained in:
@@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local assert_alive = helpers.assert_alive
|
||||
local assert_log = helpers.assert_log
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local ok = helpers.ok
|
||||
@@ -24,6 +25,28 @@ local startswith = helpers.startswith
|
||||
local write_file = helpers.write_file
|
||||
local meths = helpers.meths
|
||||
|
||||
local testfile = 'Xtest_startuptime'
|
||||
after_each(function()
|
||||
os.remove(testfile)
|
||||
end)
|
||||
|
||||
describe('startup', function()
|
||||
it('--clean', function()
|
||||
clear()
|
||||
ok(string.find(meths.get_option('runtimepath'), funcs.stdpath('config'), 1, true) ~= nil)
|
||||
clear('--clean')
|
||||
ok(string.find(meths.get_option('runtimepath'), funcs.stdpath('config'), 1, true) == nil)
|
||||
end)
|
||||
|
||||
it('--startuptime', function()
|
||||
clear({ args = {'--startuptime', testfile}})
|
||||
retry(nil, 1000, function()
|
||||
assert_log('sourcing', testfile, 100)
|
||||
assert_log("require%('vim%._editor'%)", testfile, 100)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('startup', function()
|
||||
before_each(function()
|
||||
clear()
|
||||
@@ -520,13 +543,6 @@ describe('sysinit', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('clean', function()
|
||||
clear()
|
||||
ok(string.find(meths.get_option('runtimepath'), funcs.stdpath('config'), 1, true) ~= nil)
|
||||
clear('--clean')
|
||||
ok(string.find(meths.get_option('runtimepath'), funcs.stdpath('config'), 1, true) == nil)
|
||||
end)
|
||||
|
||||
describe('user config init', function()
|
||||
local xhome = 'Xhome'
|
||||
local pathsep = helpers.get_pathsep()
|
||||
|
Reference in New Issue
Block a user