aboutsummaryrefslogtreecommitdiff
path: root/test/functional/shell/viml_system_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2014-11-27 21:30:17 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2014-12-02 16:50:52 +0100
commit1464b0eda20594f3ae99418e809038c92f470f35 (patch)
tree520c0760e6e7b49823403451b04beff89b306e62 /test/functional/shell/viml_system_spec.lua
parentecf1e672e11ec5a2d8cf97276405aca83f4d9786 (diff)
downloadrneovim-1464b0eda20594f3ae99418e809038c92f470f35.tar.gz
rneovim-1464b0eda20594f3ae99418e809038c92f470f35.tar.bz2
rneovim-1464b0eda20594f3ae99418e809038c92f470f35.zip
systemlist: add `keepempty` option to preserve final newline
Diffstat (limited to 'test/functional/shell/viml_system_spec.lua')
-rw-r--r--test/functional/shell/viml_system_spec.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/shell/viml_system_spec.lua b/test/functional/shell/viml_system_spec.lua
index 8d212c1375..29cbff66b7 100644
--- a/test/functional/shell/viml_system_spec.lua
+++ b/test/functional/shell/viml_system_spec.lua
@@ -188,6 +188,18 @@ describe('systemlist()', function()
end)
end)
+ describe('when keepempty option is', function()
+ it('0, ignores trailing newline', function()
+ eq({'aa','bb'}, eval("systemlist('cat',['aa','bb'],0)"))
+ eq({'aa','bb'}, eval("systemlist('cat',['aa','bb',''],0)"))
+ end)
+
+ it('1, preserves trailing newline', function()
+ eq({'aa','bb'}, eval("systemlist('cat',['aa','bb'],1)"))
+ eq({'aa','bb',''}, eval("systemlist('cat',['aa','bb',''],2)"))
+ end)
+ end)
+
if xclip then
describe("with a program that doesn't close stdout", function()
it('will exit properly after passing input', function()