mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
test: rename (meths, funcs) -> (api, fn)
This commit is contained in:
@@ -3,8 +3,8 @@ local screen = require('test.functional.ui.screen')
|
||||
|
||||
local testprg = helpers.testprg
|
||||
local command = helpers.command
|
||||
local funcs = helpers.funcs
|
||||
local meths = helpers.meths
|
||||
local fn = helpers.fn
|
||||
local api = helpers.api
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local matches = helpers.matches
|
||||
@@ -19,17 +19,17 @@ describe(':edit term://*', function()
|
||||
|
||||
before_each(function()
|
||||
clear()
|
||||
meths.nvim_set_option_value('shell', testprg('shell-test'), {})
|
||||
meths.nvim_set_option_value('shellcmdflag', 'EXE', {})
|
||||
api.nvim_set_option_value('shell', testprg('shell-test'), {})
|
||||
api.nvim_set_option_value('shellcmdflag', 'EXE', {})
|
||||
end)
|
||||
|
||||
it('runs TermOpen event', function()
|
||||
meths.nvim_set_var('termopen_runs', {})
|
||||
api.nvim_set_var('termopen_runs', {})
|
||||
command('autocmd TermOpen * :call add(g:termopen_runs, expand("<amatch>"))')
|
||||
command('edit term://')
|
||||
local termopen_runs = meths.nvim_get_var('termopen_runs')
|
||||
local termopen_runs = api.nvim_get_var('termopen_runs')
|
||||
eq(1, #termopen_runs)
|
||||
local cwd = funcs.fnamemodify('.', ':p:~'):gsub([[[\/]*$]], '')
|
||||
local cwd = fn.fnamemodify('.', ':p:~'):gsub([[[\/]*$]], '')
|
||||
matches('^term://' .. pesc(cwd) .. '//%d+:$', termopen_runs[1])
|
||||
end)
|
||||
|
||||
@@ -37,7 +37,7 @@ describe(':edit term://*', function()
|
||||
local columns, lines = 20, 4
|
||||
local scr = get_screen(columns, lines)
|
||||
local rep = 97
|
||||
meths.nvim_set_option_value('shellcmdflag', 'REP ' .. rep, {})
|
||||
api.nvim_set_option_value('shellcmdflag', 'REP ' .. rep, {})
|
||||
command('set shellxquote=') -- win: avoid extra quotes
|
||||
local sb = 10
|
||||
command(
|
||||
@@ -46,7 +46,7 @@ describe(':edit term://*', function()
|
||||
command('edit term://foobar')
|
||||
|
||||
local bufcontents = {}
|
||||
local winheight = meths.nvim_win_get_height(0)
|
||||
local winheight = api.nvim_win_get_height(0)
|
||||
local buf_cont_start = rep - sb - winheight + 2
|
||||
for i = buf_cont_start, (rep - 1) do
|
||||
bufcontents[#bufcontents + 1] = ('%d: foobar'):format(i)
|
||||
@@ -63,6 +63,6 @@ describe(':edit term://*', function()
|
||||
|
||||
exp_screen = exp_screen .. (' '):rep(columns) .. '|\n'
|
||||
scr:expect(exp_screen)
|
||||
eq(bufcontents, meths.nvim_buf_get_lines(0, 0, -1, true))
|
||||
eq(bufcontents, api.nvim_buf_get_lines(0, 0, -1, true))
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user