From 9cf9c4a5860212cc0f9b71d349849811fdaf61a1 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 6 Jul 2015 02:16:05 +0300 Subject: Replace references to viminfo in various places --- test/functional/ex_cmds/wviminfo_spec.lua | 33 +++++++++++++++++-------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'test/functional/ex_cmds') 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) -- cgit From 8663983cc4c2f66eb0ba58ad8e247ac0686cc79b Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 6 Jul 2015 02:26:44 +0300 Subject: Deprecate &viminfo and :[rw]v, add &shada and :[rw]sh --- test/functional/ex_cmds/wviminfo_spec.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/functional/ex_cmds') diff --git a/test/functional/ex_cmds/wviminfo_spec.lua b/test/functional/ex_cmds/wviminfo_spec.lua index 053555c267..0c85157a0f 100644 --- a/test/functional/ex_cmds/wviminfo_spec.lua +++ b/test/functional/ex_cmds/wviminfo_spec.lua @@ -3,8 +3,8 @@ local clear, execute, eq, neq, spawn, nvim_prog, set_session, wait, write_file = helpers.clear, helpers.execute, helpers.eq, helpers.neq, helpers.spawn, helpers.nvim_prog, helpers.set_session, helpers.wait, helpers.write_file -describe(':wviminfo', function() - local shada_file = 'wviminfo_test' +describe(':wshada', function() + local shada_file = 'wshada_test' local session before_each(function() @@ -23,14 +23,14 @@ describe(':wviminfo', function() it('creates a shada file', function() -- file should _not_ exist eq(nil, lfs.attributes(shada_file)) - execute('wv! '..shada_file) + execute('wsh! '..shada_file) wait() -- file _should_ exist neq(nil, lfs.attributes(shada_file)) end) it('overwrites existing files', function() - local text = 'wviminfo test' + local text = 'wshada test' -- Create a dummy file write_file(shada_file, text) @@ -39,7 +39,7 @@ describe(':wviminfo', function() eq(text, io.open(shada_file):read()) neq(nil, lfs.attributes(shada_file)) - execute('wv! '..shada_file) + execute('wsh! '..shada_file) wait() -- File should have been overwritten with a shada file. -- cgit From b249529676306760b5cd99a4707e6bf246f8b99b Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 15 Aug 2015 17:25:10 +0300 Subject: functests: Make one recover_spec test also use gdb or valgrind --- test/functional/ex_cmds/recover_spec.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/functional/ex_cmds') diff --git a/test/functional/ex_cmds/recover_spec.lua b/test/functional/ex_cmds/recover_spec.lua index b92739e40e..a24a60af81 100644 --- a/test/functional/ex_cmds/recover_spec.lua +++ b/test/functional/ex_cmds/recover_spec.lua @@ -47,7 +47,8 @@ describe(':preserve', function() --TODO(justinmk): this is an ugly hack to force `helpers` to support --multiple sessions. - local nvim2 = helpers.spawn({helpers.nvim_prog, '-u', 'NONE', '--embed'}) + local nvim2 = helpers.spawn({helpers.nvim_prog, '-u', 'NONE', '--embed'}, + true) helpers.set_session(nvim2) source(init) -- cgit