diff options
author | ZyX <kp-pav@yandex.ru> | 2017-01-29 19:32:01 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-27 00:12:42 +0300 |
commit | 295e7607c472b49e8c0762977e38c4527b746b6f (patch) | |
tree | 8c4587dd79f911ceb5a83d1553332cf7ec4f4a35 /test/functional/lua/commands_spec.lua | |
parent | e1bbaca7acf7fc498da49081d069b00aa05506df (diff) | |
download | rneovim-295e7607c472b49e8c0762977e38c4527b746b6f.tar.gz rneovim-295e7607c472b49e8c0762977e38c4527b746b6f.tar.bz2 rneovim-295e7607c472b49e8c0762977e38c4527b746b6f.zip |
executor: Fix some memory leaks
Diffstat (limited to 'test/functional/lua/commands_spec.lua')
-rw-r--r-- | test/functional/lua/commands_spec.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/lua/commands_spec.lua b/test/functional/lua/commands_spec.lua index f1d430b34c..41a5a8d9e0 100644 --- a/test/functional/lua/commands_spec.lua +++ b/test/functional/lua/commands_spec.lua @@ -62,6 +62,15 @@ describe(':lua command', function() eq(NIL, funcs.luaeval('lvar')) eq(42, funcs.luaeval('gvar')) end) + it('works with long strings', function() + local s = ('x'):rep(100500) + + eq('\nE5104: Error while creating lua chunk: [string "<VimL compiled string>"]:1: unfinished string near \'<eof>\'', redir_exec(('lua vim.api.nvim_buf_set_lines(1, 1, 2, false, {"%s})'):format(s))) + eq({''}, curbufmeths.get_lines(0, -1, false)) + + eq('', redir_exec(('lua vim.api.nvim_buf_set_lines(1, 1, 2, false, {"%s"})'):format(s))) + eq({'', s}, curbufmeths.get_lines(0, -1, false)) + end) end) describe(':luado command', function() @@ -104,6 +113,10 @@ describe(':luado command', function() end) it('works with long strings', function() local s = ('x'):rep(100500) + + eq('\nE5109: Error while creating lua chunk: [string "<VimL compiled string>"]:1: unfinished string near \'<eof>\'', redir_exec(('luado return "%s'):format(s))) + eq({''}, curbufmeths.get_lines(0, -1, false)) + eq('', redir_exec(('luado return "%s"'):format(s))) eq({s}, curbufmeths.get_lines(0, -1, false)) end) |