mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
tests: lua buffer updates: reorg check_events()
This commit is contained in:
@@ -287,7 +287,10 @@ describe('lua: nvim_buf_attach on_bytes', function()
|
||||
fail(msg)
|
||||
end
|
||||
|
||||
if verify then
|
||||
if not verify then
|
||||
return
|
||||
end
|
||||
|
||||
for _, event in ipairs(events) do
|
||||
for _, elem in ipairs(event) do
|
||||
if type(elem) == "number" and elem < 0 then
|
||||
@@ -305,8 +308,10 @@ describe('lua: nvim_buf_attach on_bytes', function()
|
||||
shadowbytes = before .. unknown .. after
|
||||
end
|
||||
end
|
||||
|
||||
local text = meths.buf_get_lines(0, 0, -1, true)
|
||||
local bytes = table.concat(text, '\n') .. '\n'
|
||||
|
||||
eq(string.len(bytes), string.len(shadowbytes), '\non_bytes: total bytecount of buffer is wrong')
|
||||
for i = 1, string.len(shadowbytes) do
|
||||
local shadowbyte = string.sub(shadowbytes, i, i)
|
||||
@@ -315,7 +320,6 @@ describe('lua: nvim_buf_attach on_bytes', function()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return check_events
|
||||
end
|
||||
|
Reference in New Issue
Block a user