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
local eq = helpers.eq
local matches = helpers.matches
local eval = helpers.eval
local exec = helpers.exec
local exec_capture = helpers.exec_capture
local exec_lua = helpers.exec_lua
local feed = helpers.feed
local fn = helpers.fn
local pesc = vim.pesc
local mkdir = helpers.mkdir
local mkdir_p = helpers.mkdir_p
local nvim_prog = helpers.nvim_prog
local nvim_set = helpers.nvim_set
local read_file = helpers.read_file
local retry = helpers.retry
local rmdir = helpers.rmdir
local sleep = vim.uv.sleep
local startswith = vim.startswith
local write_file = helpers.write_file
local api = helpers.api
local alter_slashes = helpers.alter_slashes
local is_os = helpers.is_os
local dedent = helpers.dedent
local tbl_map = vim.tbl_map
local tbl_filter = vim.tbl_filter
local endswith = vim.endswith
describe('startup', function()
it('--clean', function()
clear()
ok(
string.find(
alter_slashes(api.nvim_get_option_value('runtimepath', {})),
fn.stdpath('config'),
1,
true
) ~= nil
)
clear('--clean')
ok(
string.find(
alter_slashes(api.nvim_get_option_value('runtimepath', {})),
fn.stdpath('config'),
1,
true
) == nil
)
end)
it('prevents remote UI infinite loop', function()
clear()
local screen
screen = Screen.new(84, 3)
screen:attach()
fn.termopen({ nvim_prog, '-u', 'NONE', '--server', eval('v:servername'), '--remote-ui' })
screen:expect([[
^Cannot attach UI of :terminal child to its parent. (Unset $NVIM to skip this check) |
|*2
]])
end)
it('--startuptime', function()
local testfile = 'Xtest_startuptime'
finally(function()
os.remove(testfile)
end)
clear({ args = { '--startuptime', testfile } })
assert_log('Embedded', testfile, 100)
assert_log('sourcing', testfile, 100)
assert_log("require%('vim%._editor'%)", testfile, 100)
end)
it('-D does not hang #12647', function()
clear()
local screen
screen = Screen.new(60, 7)
screen:attach()
local id = fn.termopen({
nvim_prog,
'-u',
'NONE',
'-i',
'NONE',
'--cmd',
'set noruler',
'-D',
}, {
env = {
VIMRUNTIME = os.getenv('VIMRUNTIME'),
},
})
screen:expect([[
^ |
|
Entering Debug mode. Type "cont" to continue. |
nvim_exe
|