feat(test): add Lua forms for API methods (#20152)

This commit is contained in:
Lewis Russell
2022-11-14 10:01:35 +00:00
committed by GitHub
parent 5c5187c6f8
commit e8cc489acc
14 changed files with 160 additions and 105 deletions

View File

@@ -605,10 +605,10 @@ describe('API', function()
eq([[Error loading lua: [string "<nvim>"]:0: unexpected symbol]],
pcall_err(meths.exec_lua, 'aa=bb\0', {}))
eq([[Error executing lua: [string "<nvim>"]:0: attempt to call global 'bork' (a nil value)]],
eq([[attempt to call global 'bork' (a nil value)]],
pcall_err(meths.exec_lua, 'bork()', {}))
eq('Error executing lua: [string "<nvim>"]:0: did\nthe\nfail',
eq('did\nthe\nfail',
pcall_err(meths.exec_lua, 'error("did\\nthe\\nfail")', {}))
end)
@@ -1149,7 +1149,7 @@ describe('API', function()
end)
it('vim.paste() failure', function()
nvim('exec_lua', 'vim.paste = (function(lines, phase) error("fake fail") end)', {})
eq([[Error executing lua: [string "<nvim>"]:0: fake fail]],
eq('fake fail',
pcall_err(request, 'nvim_paste', 'line 1\nline 2\nline 3', false, 1))
end)
end)