diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-12-02 11:41:14 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-12-02 11:41:14 -0500 |
commit | 26b2f9ab11a3b50a5066c4509688e989bb4e8e92 (patch) | |
tree | c6a2526e98e33239bed8b1c40758021ed1197bab /test/functional/shell/viml_system_spec.lua | |
parent | ecf1e672e11ec5a2d8cf97276405aca83f4d9786 (diff) | |
parent | b3151af69ca545e7eac3824d6101b7b8b5701b82 (diff) | |
download | rneovim-26b2f9ab11a3b50a5066c4509688e989bb4e8e92.tar.gz rneovim-26b2f9ab11a3b50a5066c4509688e989bb4e8e92.tar.bz2 rneovim-26b2f9ab11a3b50a5066c4509688e989bb4e8e92.zip |
Merge pull request #1567 from bfredl/systemlist
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.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/shell/viml_system_spec.lua b/test/functional/shell/viml_system_spec.lua index 8d212c1375..48dc518d7b 100644 --- a/test/functional/shell/viml_system_spec.lua +++ b/test/functional/shell/viml_system_spec.lua @@ -188,6 +188,28 @@ describe('systemlist()', function() end) end) + describe('handles empty lines', function() + it('in the middle', function() + eq({'line one','','line two'}, eval("systemlist('cat',['line one','','line two'])")) + end) + + it('in the beginning', function() + eq({'','line one','line two'}, eval("systemlist('cat',['','line one','line two'])")) + 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() |