mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
tests: update tests to use [gs]et_lines instead of [gs]et_line_slice
This commit is contained in:
@@ -165,8 +165,8 @@ describe('server -> client', function()
|
||||
|
||||
eq('SOME TEXT', eval("rpcrequest(vim, 'buffer_get_line', "..buf..", 0)"))
|
||||
|
||||
-- Call get_line_slice(buf, range [0,0], includes start, includes end)
|
||||
eq({'SOME TEXT'}, eval("rpcrequest(vim, 'buffer_get_line_slice', "..buf..", 0, 0, 1, 1)"))
|
||||
-- Call get_lines(buf, range [0,0], strict_indexing)
|
||||
eq({'SOME TEXT'}, eval("rpcrequest(vim, 'buffer_get_lines', "..buf..", 0, 1, 1)"))
|
||||
end)
|
||||
|
||||
it('returns an error if the request failed', function()
|
||||
|
||||
@@ -14,7 +14,7 @@ describe('TextYankPost', function()
|
||||
execute('autocmd TextYankPost * let g:event = copy(v:event)')
|
||||
execute('autocmd TextYankPost * let g:count += 1')
|
||||
|
||||
curbufmeths.set_line_slice(0, -1, true, true, {
|
||||
curbufmeths.set_lines(0, -1, true, {
|
||||
'foo\0bar',
|
||||
'baz text',
|
||||
})
|
||||
|
||||
@@ -320,7 +320,7 @@ local function curbuf_contents()
|
||||
-- previously sent keys are processed(vim_eval is a deferred function, and
|
||||
-- only processed after all input)
|
||||
wait()
|
||||
return table.concat(curbuf('get_line_slice', 0, -1, true, true), '\n')
|
||||
return table.concat(curbuf('get_lines', 0, -1, true), '\n')
|
||||
end
|
||||
|
||||
local function curwin(method, ...)
|
||||
|
||||
@@ -2215,7 +2215,7 @@ describe('In plugin/shada.vim', function()
|
||||
describe('event BufWriteCmd', function()
|
||||
it('works', function()
|
||||
nvim('set_var', 'shada#add_own_header', 0)
|
||||
curbuf('set_line_slice', 0, 0, true, true, {
|
||||
curbuf('set_lines', 0, 1, true, {
|
||||
'Jump with timestamp ' .. epoch .. ':',
|
||||
' % Key________ Description Value',
|
||||
' + n name \'A\'',
|
||||
@@ -2271,7 +2271,7 @@ describe('In plugin/shada.vim', function()
|
||||
describe('event FileWriteCmd', function()
|
||||
it('works', function()
|
||||
nvim('set_var', 'shada#add_own_header', 0)
|
||||
curbuf('set_line_slice', 0, 0, true, true, {
|
||||
curbuf('set_lines', 0, 1, true, {
|
||||
'Jump with timestamp ' .. epoch .. ':',
|
||||
' % Key________ Description Value',
|
||||
' + n name \'A\'',
|
||||
@@ -2310,7 +2310,7 @@ describe('In plugin/shada.vim', function()
|
||||
describe('event FileAppendCmd', function()
|
||||
it('works', function()
|
||||
nvim('set_var', 'shada#add_own_header', 0)
|
||||
curbuf('set_line_slice', 0, 0, true, true, {
|
||||
curbuf('set_lines', 0, 1, true, {
|
||||
'Jump with timestamp ' .. epoch .. ':',
|
||||
' % Key________ Description Value',
|
||||
' + n name \'A\'',
|
||||
@@ -2512,7 +2512,7 @@ describe('syntax/shada.vim', function()
|
||||
it('works', function()
|
||||
nvim_command('syntax on')
|
||||
nvim_command('setlocal syntax=shada')
|
||||
curbuf('set_line_slice', 0, 0, true, true, {
|
||||
curbuf('set_lines', 0, 1, true, {
|
||||
'Header with timestamp ' .. epoch .. ':',
|
||||
' % Key Value',
|
||||
' + t "test"',
|
||||
|
||||
@@ -70,6 +70,6 @@ describe(':edit term://*', function()
|
||||
end
|
||||
exp_screen = exp_screen .. (' '):rep(columns) .. '|\n'
|
||||
scr:expect(exp_screen)
|
||||
eq(bufcontents, curbufmeths.get_line_slice(1, -1, true, true))
|
||||
eq(bufcontents, curbufmeths.get_lines(1, -1, true))
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user