diff options
author | ZyX <kp-pav@yandex.ru> | 2015-07-06 02:16:05 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2015-10-08 22:00:06 +0300 |
commit | 9cf9c4a5860212cc0f9b71d349849811fdaf61a1 (patch) | |
tree | 82335adcdca0627d7c615ee198a19ec63170a959 /test/functional/ex_cmds/wviminfo_spec.lua | |
parent | 749cae866278469d11e6ec467dd0e98ab6233439 (diff) | |
download | rneovim-9cf9c4a5860212cc0f9b71d349849811fdaf61a1.tar.gz rneovim-9cf9c4a5860212cc0f9b71d349849811fdaf61a1.tar.bz2 rneovim-9cf9c4a5860212cc0f9b71d349849811fdaf61a1.zip |
Replace references to viminfo in various places
Diffstat (limited to 'test/functional/ex_cmds/wviminfo_spec.lua')
-rw-r--r-- | test/functional/ex_cmds/wviminfo_spec.lua | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/test/functional/ex_cmds/wviminfo_spec.lua b/test/functional/ex_cmds/wviminfo_spec.lua index f4911cd3e8..053555c267 100644 --- a/test/functional/ex_cmds/wviminfo_spec.lua +++ b/test/functional/ex_cmds/wviminfo_spec.lua @@ -4,7 +4,7 @@ local clear, execute, eq, neq, spawn, nvim_prog, set_session, wait, write_file helpers.nvim_prog, helpers.set_session, helpers.wait, helpers.write_file describe(':wviminfo', function() - local viminfo_file = 'wviminfo_test' + local shada_file = 'wviminfo_test' local session before_each(function() @@ -17,38 +17,41 @@ describe(':wviminfo', function() '--cmd', 'set swapfile'}) set_session(session) - os.remove(viminfo_file) + os.remove(shada_file) end) - it('creates a viminfo file', function() + it('creates a shada file', function() -- file should _not_ exist - eq(nil, lfs.attributes(viminfo_file)) - execute('wv! '..viminfo_file) + eq(nil, lfs.attributes(shada_file)) + execute('wv! '..shada_file) wait() -- file _should_ exist - neq(nil, lfs.attributes(viminfo_file)) + neq(nil, lfs.attributes(shada_file)) end) it('overwrites existing files', function() local text = 'wviminfo test' -- Create a dummy file - write_file(viminfo_file, text) + write_file(shada_file, text) -- sanity check - eq(text, io.open(viminfo_file):read()) - neq(nil, lfs.attributes(viminfo_file)) + eq(text, io.open(shada_file):read()) + neq(nil, lfs.attributes(shada_file)) - execute('wv! '..viminfo_file) + execute('wv! '..shada_file) wait() - -- File should have been overwritten with a viminfo file. - local line1 = io.lines(viminfo_file)() - assert(nil ~= string.find(line1, 'This viminfo file was generated by Nvim'), - viminfo_file..' should be a viminfo-formatted 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') end) teardown(function() - os.remove(viminfo_file) + os.remove(shada_file) end) end) |