aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/buffer_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/api/buffer_spec.lua')
-rw-r--r--test/functional/api/buffer_spec.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua
index e7e2168238..552e3a8564 100644
--- a/test/functional/api/buffer_spec.lua
+++ b/test/functional/api/buffer_spec.lua
@@ -4,6 +4,9 @@ local curbuf, curwin, eq = helpers.curbuf, helpers.curwin, helpers.eq
local curbufmeths, ok = helpers.curbufmeths, helpers.ok
local funcs = helpers.funcs
local request = helpers.request
+local exc_exec = helpers.exc_exec
+local execute = helpers.execute
+local insert = helpers.insert
local NIL = helpers.NIL
local meth_pcall = helpers.meth_pcall
local command = helpers.command
@@ -242,6 +245,22 @@ describe('api/buf', function()
eq({'e', 'a', 'b', 'c', 'd'}, get_lines(0, -1, true))
end)
+ it("set_line on alternate buffer does not access invalid line (E315)", function()
+ execute('set hidden')
+ insert('Initial file')
+ command('enew')
+ insert([[
+ More
+ Lines
+ Than
+ In
+ The
+ Other
+ Buffer]])
+ execute('$')
+ local retval = exc_exec("call nvim_buf_set_lines(1, 0, 1, v:false, ['test'])")
+ eq(0, retval)
+ end)
end)
describe('{get,set,del}_var', function()