aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-06-17 14:22:02 +0200
committerJustin M. Keyes <justinkz@gmail.com>2018-06-17 14:50:53 +0200
commit487cf98c0b61ade023fc71d945a64e61f8374eac (patch)
tree165ff97f2e0f2f0944af1dc37bfec6bdf71794b3 /test
parent9c2099d5850a6a434f7269913d316d57da1362e2 (diff)
downloadrneovim-487cf98c0b61ade023fc71d945a64e61f8374eac.tar.gz
rneovim-487cf98c0b61ade023fc71d945a64e61f8374eac.tar.bz2
rneovim-487cf98c0b61ade023fc71d945a64e61f8374eac.zip
startup: fix -E/-Es without `-u NONE`
Before this change, -E/-Es without `-u NONE` reads stdin as Ex commands. It should always read stdin as text (into buffer 1), like this: echo foo | nvim -Es +'%p' foo echo foo | nvim -Es -u NORC +'%p' foo
Diffstat (limited to 'test')
-rw-r--r--test/functional/core/startup_spec.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua
index c20ac668c4..ae5e2b4115 100644
--- a/test/functional/core/startup_spec.lua
+++ b/test/functional/core/startup_spec.lua
@@ -157,6 +157,14 @@ describe('startup', function()
eq(inputstr,
funcs.system({nvim_prog, '-i', 'NONE', '-Es', '+%print', '-' },
input))
+ -- with `-u NORC`
+ eq('thepartycontinues\n',
+ funcs.system({nvim_prog, '-n', '-u', 'NORC', '-Es', '+.print' },
+ { 'thepartycontinues', '' }))
+ -- without `-u`
+ eq('thepartycontinues\n',
+ funcs.system({nvim_prog, '-n', '-Es', '+.print' },
+ { 'thepartycontinues', '' }))
--
-- -es: read stdin as ex-commands
@@ -167,6 +175,14 @@ describe('startup', function()
eq('line1\nline2\n',
funcs.system({nvim_prog, '-i', 'NONE', '-es', '-' },
input))
+ -- with `-u NORC`
+ eq(' encoding=utf-8\n',
+ funcs.system({nvim_prog, '-n', '-u', 'NORC', '-es' },
+ { 'set encoding', '' }))
+ -- without `-u`
+ eq(' encoding=utf-8\n',
+ funcs.system({nvim_prog, '-n', '-es' },
+ { 'set encoding', '' }))
end)
end)