mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
functests: Move exc_exec to test.functional.helpers
This commit is contained in:
parent
56a2549ff8
commit
7085ea07d8
@ -3,12 +3,12 @@ local helpers = require('test.functional.helpers')
|
||||
local nvim, nvim_window, nvim_curwin, nvim_command, nvim_feed, nvim_eval, eq =
|
||||
helpers.nvim, helpers.window, helpers.curwin, helpers.command, helpers.feed,
|
||||
helpers.eval, helpers.eq
|
||||
local exc_exec = helpers.exc_exec
|
||||
|
||||
local shada_helpers = require('test.functional.shada.helpers')
|
||||
local reset, set_additional_cmd, clear, exc_exec, get_shada_rw =
|
||||
local reset, set_additional_cmd, clear, get_shada_rw =
|
||||
shada_helpers.reset, shada_helpers.set_additional_cmd,
|
||||
shada_helpers.clear, shada_helpers.exc_exec,
|
||||
shada_helpers.get_shada_rw
|
||||
shada_helpers.clear, shada_helpers.get_shada_rw
|
||||
local read_shada_file = shada_helpers.read_shada_file
|
||||
|
||||
local wshada, sdrcmd, shada_fname = get_shada_rw('Xtest-functional-shada-compatibility.shada')
|
||||
|
@ -3,12 +3,12 @@ local helpers = require('test.functional.helpers')
|
||||
local nvim, nvim_window, nvim_curwin, nvim_command, nvim_feed, nvim_eval, eq =
|
||||
helpers.nvim, helpers.window, helpers.curwin, helpers.command, helpers.feed,
|
||||
helpers.eval, helpers.eq
|
||||
local exc_exec = helpers.exc_exec
|
||||
|
||||
local shada_helpers = require('test.functional.shada.helpers')
|
||||
local reset, set_additional_cmd, clear, exc_exec, get_shada_rw =
|
||||
local reset, set_additional_cmd, clear, get_shada_rw =
|
||||
shada_helpers.reset, shada_helpers.set_additional_cmd,
|
||||
shada_helpers.clear, shada_helpers.exc_exec,
|
||||
shada_helpers.get_shada_rw
|
||||
shada_helpers.clear, shada_helpers.get_shada_rw
|
||||
|
||||
local wshada, sdrcmd, shada_fname, clean =
|
||||
get_shada_rw('Xtest-functional-shada-errors.shada')
|
||||
|
@ -42,19 +42,6 @@ local clear = function()
|
||||
set_additional_cmd('')
|
||||
end
|
||||
|
||||
local exc_exec = function(cmd)
|
||||
nvim_command(([[
|
||||
try
|
||||
execute "%s"
|
||||
catch
|
||||
let g:__exception = v:exception
|
||||
endtry
|
||||
]]):format(cmd:gsub('\n', '\\n'):gsub('[\\"]', '\\%0')))
|
||||
local ret = nvim_eval('get(g:, "__exception", 0)')
|
||||
nvim_command('unlet! g:__exception')
|
||||
return ret
|
||||
end
|
||||
|
||||
local get_shada_rw = function(fname)
|
||||
local wshada = function(text)
|
||||
write_file(fname, text, true)
|
||||
|
@ -3,11 +3,12 @@ local helpers = require('test.functional.helpers')
|
||||
local nvim, nvim_window, nvim_curwin, nvim_command, nvim_feed, nvim_eval, eq =
|
||||
helpers.nvim, helpers.window, helpers.curwin, helpers.command, helpers.feed,
|
||||
helpers.eval, helpers.eq
|
||||
local exc_exec = helpers.exc_exec
|
||||
|
||||
local shada_helpers = require('test.functional.shada.helpers')
|
||||
local reset, set_additional_cmd, clear, exc_exec =
|
||||
local reset, set_additional_cmd, clear =
|
||||
shada_helpers.reset, shada_helpers.set_additional_cmd,
|
||||
shada_helpers.clear, shada_helpers.exc_exec
|
||||
shada_helpers.clear
|
||||
|
||||
local nvim_current_line = function()
|
||||
return nvim_window('get_cursor', nvim_curwin())[1]
|
||||
|
@ -3,12 +3,12 @@ local helpers = require('test.functional.helpers')
|
||||
local nvim, nvim_window, nvim_curwin, nvim_command, nvim_feed, nvim_eval, eq =
|
||||
helpers.nvim, helpers.window, helpers.curwin, helpers.command, helpers.feed,
|
||||
helpers.eval, helpers.eq
|
||||
local exc_exec = helpers.exc_exec
|
||||
|
||||
local shada_helpers = require('test.functional.shada.helpers')
|
||||
local reset, set_additional_cmd, clear, exc_exec, get_shada_rw =
|
||||
local reset, set_additional_cmd, clear, get_shada_rw =
|
||||
shada_helpers.reset, shada_helpers.set_additional_cmd,
|
||||
shada_helpers.clear, shada_helpers.exc_exec,
|
||||
shada_helpers.get_shada_rw
|
||||
shada_helpers.clear, shada_helpers.get_shada_rw
|
||||
local read_shada_file = shada_helpers.read_shada_file
|
||||
|
||||
local wshada, sdrcmd, shada_fname =
|
||||
|
@ -3,17 +3,17 @@ local helpers = require('test.functional.helpers')
|
||||
local nvim, nvim_window, nvim_curwin, nvim_command, nvim_feed, nvim_eval, eq =
|
||||
helpers.nvim, helpers.window, helpers.curwin, helpers.command, helpers.feed,
|
||||
helpers.eval, helpers.eq
|
||||
local write_file, spawn, set_session, nvim_prog =
|
||||
helpers.write_file, helpers.spawn, helpers.set_session, helpers.nvim_prog
|
||||
local write_file, spawn, set_session, nvim_prog, exc_exec =
|
||||
helpers.write_file, helpers.spawn, helpers.set_session, helpers.nvim_prog,
|
||||
helpers.exc_exec
|
||||
local lfs = require('lfs')
|
||||
|
||||
local msgpack = require('MessagePack')
|
||||
|
||||
local shada_helpers = require('test.functional.shada.helpers')
|
||||
local reset, set_additional_cmd, clear, exc_exec, get_shada_rw =
|
||||
local reset, set_additional_cmd, clear, get_shada_rw =
|
||||
shada_helpers.reset, shada_helpers.set_additional_cmd,
|
||||
shada_helpers.clear, shada_helpers.exc_exec,
|
||||
shada_helpers.get_shada_rw
|
||||
shada_helpers.clear, shada_helpers.get_shada_rw
|
||||
local read_shada_file = shada_helpers.read_shada_file
|
||||
|
||||
local wshada, sdrcmd, shada_fname, clean = get_shada_rw('Xtest-functional-shada-shada.shada')
|
||||
|
Loading…
Reference in New Issue
Block a user