diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-05-27 03:41:02 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-06-04 02:09:27 +0200 |
commit | 63058fb5b05a1293dd50851af46f33fc15110829 (patch) | |
tree | 1f5c34e920bc2deec4cdc44e61af0644d25323d1 /test/functional/core/startup_spec.lua | |
parent | 787ae1b38bb388e2ee236e89091e87932fd0efb3 (diff) | |
download | rneovim-63058fb5b05a1293dd50851af46f33fc15110829.tar.gz rneovim-63058fb5b05a1293dd50851af46f33fc15110829.tar.bz2 rneovim-63058fb5b05a1293dd50851af46f33fc15110829.zip |
startup: fix -es/-Es so they are actually silent
silent-mode (-es/-Es) has been broken for years. The workaround up to
now was to include --headless. But --headless is not equivalent because
it prints all messages, not the limited subset defined by silent-mode.
Diffstat (limited to 'test/functional/core/startup_spec.lua')
-rw-r--r-- | test/functional/core/startup_spec.lua | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 0d4199ea6e..b8af5de664 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -109,13 +109,14 @@ describe('startup', function() ]]) end) it('input from pipe (implicit) + file args #7679', function() + if helpers.pending_win32(pending) then return end local screen = Screen.new(25, 3) screen:attach() if iswin() then command([[set shellcmdflag=/s\ /c shellxquote=\"]]) end command([[exe "terminal echo ohyeah | "]] -- Input from a pipe. - ..[[.shellescape(v:progpath)." -u NONE -i NONE --cmd \"]] + ..[[.shellescape(v:progpath)." -n -u NONE -i NONE --cmd \"]] ..nvim_set..[[\"]] ..[[ --cmd \"set shortmess+=I\"]] ..[[ -c \"echo has('ttyin') has('ttyout') 'bufs='.bufnr('$')\"]] @@ -128,5 +129,33 @@ describe('startup', function() | ]]) end) + + it('stdin with -es, -Es #7679', function() + local input = { 'append', 'line1', 'line2', '.', '%print', '' } + local inputstr = table.concat(input, '\n') + + -- + -- -Es: read stdin as text + -- + if not iswin() then + eq('partylikeits1999\n', + funcs.system({nvim_prog, '-n', '-u', 'NONE', '-i', 'NONE', '-Es', '+.print', 'test/functional/fixtures/tty-test.c' }, + { 'partylikeits1999' })) + eq(inputstr, + funcs.system({nvim_prog, '-i', 'NONE', '-Es', '+%print', '-' }, + input)) + end + + + -- + -- -es: read stdin as ex-commands + -- + eq(' encoding=utf-8\n', + funcs.system({nvim_prog, '-n', '-u', 'NONE', '-i', 'NONE', '-es', 'test/functional/fixtures/tty-test.c' }, + { 'set encoding', '' })) + eq('line1\nline2\n', + funcs.system({nvim_prog, '-i', 'NONE', '-es', '-' }, + input)) + end) end) |