diff options
Diffstat (limited to 'test/functional/shada/helpers.lua')
-rw-r--r-- | test/functional/shada/helpers.lua | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/test/functional/shada/helpers.lua b/test/functional/shada/helpers.lua index cd99d38345..baa27889f3 100644 --- a/test/functional/shada/helpers.lua +++ b/test/functional/shada/helpers.lua @@ -1,10 +1,8 @@ local helpers = require('test.functional.helpers')(nil) -local meths = helpers.meths +local api = helpers.api local write_file = helpers.write_file local concat_tables = helpers.concat_tables -local mpack = require('mpack') - local tmpname = helpers.tmpname() -- o={ @@ -17,19 +15,20 @@ local function reset(o) o = o and o or {} local args_rm = o.args_rm or {} table.insert(args_rm, '-i') - local args={ - '-i', o.shadafile or tmpname, + local args = { + '-i', + o.shadafile or tmpname, } if type(o) == 'string' then - args = concat_tables(args, {'--cmd', o}) + args = concat_tables(args, { '--cmd', o }) elseif o.args then args = concat_tables(args, o.args) end - helpers.clear{ - args_rm=args_rm, - args=args, + helpers.clear { + args_rm = args_rm, + args = args, } - meths.set_var('tmpname', tmpname) + api.nvim_set_var('tmpname', tmpname) end local clear = function() @@ -57,13 +56,13 @@ local get_shada_rw = function(fname) return wshada, sdrcmd, fname, clean end -local mpack_keys = {'type', 'timestamp', 'length', 'value'} +local mpack_keys = { 'type', 'timestamp', 'length', 'value' } local read_shada_file = function(fname) local fd = io.open(fname, 'r') local mstring = fd:read('*a') fd:close() - local unpack = mpack.Unpacker() + local unpack = vim.mpack.Unpacker() local ret = {} local cur, val local i = 0 @@ -81,8 +80,8 @@ local read_shada_file = function(fname) end return { - reset=reset, - clear=clear, - get_shada_rw=get_shada_rw, - read_shada_file=read_shada_file, + reset = reset, + clear = clear, + get_shada_rw = get_shada_rw, + read_shada_file = read_shada_file, } |