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