diff options
author | Jakob Schnitzer <mail@jakobschnitzer.de> | 2017-04-24 11:35:10 +0200 |
---|---|---|
committer | Jakob Schnitzer <mail@jakobschnitzer.de> | 2017-04-24 11:35:10 +0200 |
commit | ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1 (patch) | |
tree | 526b1df09b06121bdbc6ef5254ef53821958a6cb /test/functional/api/vim_spec.lua | |
parent | 4049492b6d7b8805686b14dbacb3b729abd03308 (diff) | |
parent | 7f6d3d305269fd1139bc2aec9a91bf98ad595199 (diff) | |
download | rneovim-ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1.tar.gz rneovim-ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1.tar.bz2 rneovim-ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1.zip |
Merge branch 'master' into option-fixes
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 8f9f155110..5b173f3196 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -119,7 +119,7 @@ describe('api', function() eq(1, funcs.exists('g:lua')) meths.del_var('lua') eq(0, funcs.exists('g:lua')) - eq({false, 'Key "lua" doesn\'t exist'}, meth_pcall(meths.del_var, 'lua')) + eq({false, 'Key does not exist: lua'}, meth_pcall(meths.del_var, 'lua')) meths.set_var('lua', 1) command('lockvar lua') eq({false, 'Key is locked: lua'}, meth_pcall(meths.del_var, 'lua')) @@ -412,7 +412,7 @@ describe('api', function() eq(5, meths.get_var('avar')) end) - it('throws error on malformated arguments', function() + it('throws error on malformed arguments', function() local req = { {'nvim_set_var', {'avar', 1}}, {'nvim_set_var'}, @@ -439,7 +439,7 @@ describe('api', function() } status, err = pcall(meths.call_atomic, req) eq(false, status) - ok(err:match('args must be Array') ~= nil) + ok(err:match('Args must be Array') ~= nil) -- call before was done, but not after eq(1, meths.get_var('avar')) eq({''}, meths.buf_get_lines(0, 0, -1, true)) @@ -452,6 +452,13 @@ describe('api', function() ok(err:match('Invalid option name') ~= nil) end) + it('does not truncate error message <1 MB #5984', function() + local very_long_name = 'A'..('x'):rep(10000)..'Z' + local status, err = pcall(nvim, 'get_option', very_long_name) + eq(false, status) + eq(very_long_name, err:match('Ax+Z?')) + end) + it("doesn't leak memory on incorrect argument types", function() local status, err = pcall(nvim, 'set_current_dir',{'not', 'a', 'dir'}) eq(false, status) |