diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-07-01 08:16:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-01 08:16:34 +0800 |
commit | 628f6cce80dea9ef15e23a3ded77dc3f0c912b51 (patch) | |
tree | 0156945d78475ea994ee85a34ae07bc1958e3ba8 /test/functional/core/startup_spec.lua | |
parent | 2493815290c4cb5b1fb97b6d010c10bdf2d47a58 (diff) | |
download | rneovim-628f6cce80dea9ef15e23a3ded77dc3f0c912b51.tar.gz rneovim-628f6cce80dea9ef15e23a3ded77dc3f0c912b51.tar.bz2 rneovim-628f6cce80dea9ef15e23a3ded77dc3f0c912b51.zip |
fix(startup): don't truncate when printing with -l (#24216)
Diffstat (limited to 'test/functional/core/startup_spec.lua')
-rw-r--r-- | test/functional/core/startup_spec.lua | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index ef3c2eadd9..3f284c5c9e 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -101,10 +101,11 @@ describe('startup', function() it('os.exit() sets Nvim exitcode', function() -- tricky: LeakSanitizer triggers on os.exit() and disrupts the return value, disable it exec_lua [[ - local asan_options = os.getenv 'ASAN_OPTIONS' - if asan_options ~= nil and asan_options ~= '' then - vim.uv.os_setenv('ASAN_OPTIONS', asan_options..':detect_leaks=0') + local asan_options = os.getenv('ASAN_OPTIONS') or '' + if asan_options ~= '' then + asan_options = asan_options .. ':' end + vim.uv.os_setenv('ASAN_OPTIONS', asan_options .. ':detect_leaks=0') ]] -- nvim -l foo.lua -arg1 -- a b c assert_l_out([[ @@ -143,6 +144,14 @@ describe('startup', function() eq(0, eval('v:shell_error')) end) + it('does not truncate long print() message', function() + assert_l_out(('k'):rep(1234), + nil, + nil, + '-', + "print(('k'):rep(1234))") + end) + it('sets _G.arg', function() -- nvim -l foo.lua assert_l_out([[ @@ -219,6 +228,15 @@ describe('startup', function() end) end) + it('--cmd/-c/+ do not truncate long Lua print() message with --headless', function() + local out = funcs.system({ nvim_prog, '-u', 'NONE', '-i', 'NONE', '--headless', + '--cmd', 'lua print(("A"):rep(1234))', + '-c', 'lua print(("B"):rep(1234))', + '+lua print(("C"):rep(1234))', + '+q' }) + eq(('A'):rep(1234) .. '\r\n' .. ('B'):rep(1234) .. '\r\n' .. ('C'):rep(1234), out) + end) + it('pipe at both ends: has("ttyin")==0 has("ttyout")==0', function() -- system() puts a pipe at both ends. local out = funcs.system({ nvim_prog, '-u', 'NONE', '-i', 'NONE', '--headless', |