diff options
author | ZyX <kp-pav@yandex.ru> | 2017-01-29 23:22:50 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-27 00:13:16 +0300 |
commit | 9fd2bf67aa1db66e3465753d5aaaec342f4ce193 (patch) | |
tree | c07db015f38c00b6ab3bf8c4b76a86910f46ad09 /test/functional/lua/commands_spec.lua | |
parent | ebad04622056b0cb88e2b25211746b57fb4ef3c2 (diff) | |
download | rneovim-9fd2bf67aa1db66e3465753d5aaaec342f4ce193.tar.gz rneovim-9fd2bf67aa1db66e3465753d5aaaec342f4ce193.tar.bz2 rneovim-9fd2bf67aa1db66e3465753d5aaaec342f4ce193.zip |
executor,functests: Add print() tests, some fixes
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 80fac07f8c..017ee55729 100644 --- a/test/functional/lua/commands_spec.lua +++ b/test/functional/lua/commands_spec.lua @@ -46,6 +46,10 @@ describe(':lua command', function() exc_exec('lua vim.api.nvim_buf_set_lines(-10, 1, 1, false, {"TEST"})')) eq({''}, curbufmeths.get_lines(0, 100, false)) end) + it('works with NULL errors', function() + eq([=[Vim(lua):E5105: Error while calling lua chunk: [NULL]]=], + exc_exec('lua error(nil)')) + end) it('accepts embedded NLs without heredoc', function() -- Such code is usually used for `:execute 'lua' {generated_string}`: -- heredocs do not work in this case. @@ -106,6 +110,10 @@ describe(':luado command', function() eq([[Vim(luado):E5111: Error while calling lua function: [string "<VimL compiled string>"]:1: attempt to perform arithmetic on global 'liness' (a nil value)]], exc_exec('luado return liness + 1')) end) + it('works with NULL errors', function() + eq([=[Vim(luado):E5111: Error while calling lua function: [NULL]]=], + exc_exec('luado error(nil)')) + end) it('fails in sandbox when needed', function() curbufmeths.set_lines(0, 1, false, {"ABC", "def", "gHi"}) eq('\nE48: Not allowed in sandbox: sandbox luado runs = (runs or 0) + 1', @@ -148,4 +156,9 @@ describe(':luafile', function() eq(("Vim(luafile):E5113: Error while calling lua chunk: %s:1: attempt to index global 'vimm' (a nil value)"):format(fname), exc_exec('luafile ' .. fname)) end) + it('works with NULL errors', function() + write_file(fname, 'error(nil)') + eq([=[Vim(luafile):E5113: Error while calling lua chunk: [NULL]]=], + exc_exec('luafile ' .. fname)) + end) end) |