diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-01-03 02:09:18 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2024-01-03 02:09:29 +0100 |
commit | 04f2f864e270e772c6326cefdf24947f0130e492 (patch) | |
tree | 46f83f909b888a66c741032ab955afc6eab84292 /test/functional/ex_cmds/wviminfo_spec.lua | |
parent | 59d117ec99b6037cb9fad5bbfb6d0b18f5012927 (diff) | |
download | rneovim-04f2f864e270e772c6326cefdf24947f0130e492.tar.gz rneovim-04f2f864e270e772c6326cefdf24947f0130e492.tar.bz2 rneovim-04f2f864e270e772c6326cefdf24947f0130e492.zip |
refactor: format test/*
Diffstat (limited to 'test/functional/ex_cmds/wviminfo_spec.lua')
-rw-r--r-- | test/functional/ex_cmds/wviminfo_spec.lua | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/test/functional/ex_cmds/wviminfo_spec.lua b/test/functional/ex_cmds/wviminfo_spec.lua index 7525343891..5e840c2ab5 100644 --- a/test/functional/ex_cmds/wviminfo_spec.lua +++ b/test/functional/ex_cmds/wviminfo_spec.lua @@ -1,8 +1,7 @@ local helpers = require('test.functional.helpers')(after_each) local luv = require('luv') local clear = helpers.clear -local command, eq, neq, write_file = - helpers.command, helpers.eq, helpers.neq, helpers.write_file +local command, eq, neq, write_file = helpers.command, helpers.eq, helpers.neq, helpers.write_file local read_file = helpers.read_file local is_os = helpers.is_os @@ -10,19 +9,25 @@ describe(':wshada', function() local shada_file = 'wshada_test' before_each(function() - clear{args={'-i', is_os('win') and 'nul' or '/dev/null', - -- Need 'swapfile' for these tests. - '--cmd', 'set swapfile undodir=. directory=. viewdir=. backupdir=. belloff= noshowcmd noruler'}, - args_rm={'-n', '-i', '--cmd'}} + clear { + args = { + '-i', + is_os('win') and 'nul' or '/dev/null', + -- Need 'swapfile' for these tests. + '--cmd', + 'set swapfile undodir=. directory=. viewdir=. backupdir=. belloff= noshowcmd noruler', + }, + args_rm = { '-n', '-i', '--cmd' }, + } end) - after_each(function () + after_each(function() os.remove(shada_file) end) it('creates a shada file', function() -- file should _not_ exist eq(nil, luv.fs_stat(shada_file)) - command('wsh! '..shada_file) + command('wsh! ' .. shada_file) -- file _should_ exist neq(nil, luv.fs_stat(shada_file)) end) @@ -37,14 +42,13 @@ describe(':wshada', function() eq(text, read_file(shada_file)) neq(nil, luv.fs_stat(shada_file)) - command('wsh! '..shada_file) + command('wsh! ' .. shada_file) -- File should have been overwritten with a shada file. local fp = io.open(shada_file, 'r') local char1 = fp:read(1) fp:close() -- ShaDa file starts with a “header” entry - assert(char1:byte() == 0x01, - shada_file..' should be a shada file') + assert(char1:byte() == 0x01, shada_file .. ' should be a shada file') end) end) |