aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2015-07-06 02:26:44 +0300
committerZyX <kp-pav@yandex.ru>2015-10-08 22:00:07 +0300
commit8663983cc4c2f66eb0ba58ad8e247ac0686cc79b (patch)
treeef304ae2b4ccad0f4dac03de8d877290b2943538 /test
parent9cf9c4a5860212cc0f9b71d349849811fdaf61a1 (diff)
downloadrneovim-8663983cc4c2f66eb0ba58ad8e247ac0686cc79b.tar.gz
rneovim-8663983cc4c2f66eb0ba58ad8e247ac0686cc79b.tar.bz2
rneovim-8663983cc4c2f66eb0ba58ad8e247ac0686cc79b.zip
Deprecate &viminfo and :[rw]v, add &shada and :[rw]sh
Diffstat (limited to 'test')
-rw-r--r--test/functional/ex_cmds/wviminfo_spec.lua10
-rw-r--r--test/functional/legacy/074_global_var_in_viminfo_spec.lua6
-rw-r--r--test/functional/shada/buffers_spec.lua28
-rw-r--r--test/functional/shada/history_spec.lua62
-rw-r--r--test/functional/shada/marks_spec.lua22
-rw-r--r--test/functional/shada/registers_spec.lua16
-rw-r--r--test/functional/shada/variables_spec.lua48
7 files changed, 96 insertions, 96 deletions
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.
diff --git a/test/functional/legacy/074_global_var_in_viminfo_spec.lua b/test/functional/legacy/074_global_var_in_viminfo_spec.lua
index f017ed80a8..2428b7f74d 100644
--- a/test/functional/legacy/074_global_var_in_viminfo_spec.lua
+++ b/test/functional/legacy/074_global_var_in_viminfo_spec.lua
@@ -28,7 +28,7 @@ describe('storing global variables in ShaDa files', function()
execute(
-- This will cause a few errors, do it silently.
'set visualbell',
- 'set viminfo+=!',
+ 'set shada+=!',
"let MY_GLOBAL_DICT={'foo': 1, 'bar': 0, 'longvarible': 1000}",
-- Store a really long list. Initially this was testing line wrapping in
-- viminfo, but shada files has no line wrapping, no matter how long the
@@ -38,7 +38,7 @@ describe('storing global variables in ShaDa files', function()
eq(test_dict, eval('MY_GLOBAL_DICT'))
eq(test_list, eval('MY_GLOBAL_LIST'))
- execute('wv! ' .. tempname)
+ execute('wsh! ' .. tempname)
wait()
-- Assert that the shada file exists.
@@ -49,7 +49,7 @@ describe('storing global variables in ShaDa files', function()
eq(0, eval('exists("MY_GLOBAL_DICT")'))
eq(0, eval('exists("MY_GLOBAL_LIST")'))
- execute('rv! ' .. tempname)
+ execute('rsh! ' .. tempname)
eq(test_list, eval('MY_GLOBAL_LIST'))
eq(test_dict, eval('MY_GLOBAL_DICT'))
diff --git a/test/functional/shada/buffers_spec.lua b/test/functional/shada/buffers_spec.lua
index 97dafa533b..38a8cad84d 100644
--- a/test/functional/shada/buffers_spec.lua
+++ b/test/functional/shada/buffers_spec.lua
@@ -20,45 +20,45 @@ describe('ShaDa support code', function()
after_each(clear)
it('is able to dump and restore buffer list', function()
- set_additional_cmd('set viminfo+=%')
+ set_additional_cmd('set shada+=%')
reset()
nvim_command('edit ' .. testfilename)
nvim_command('edit ' .. testfilename_2)
- -- nvim_command('redir! > /tmp/vistr | verbose set viminfo? | redir END')
- -- nvim_command('wviminfo /tmp/foo')
+ -- nvim_command('redir! > /tmp/vistr | verbose set shada? | redir END')
+ -- nvim_command('wshada /tmp/foo')
nvim_command('qall')
reset()
- -- nvim_command('call writefile([&viminfo], "/tmp/vistr")')
+ -- nvim_command('call writefile([&shada], "/tmp/vistr")')
eq(3, nvim_eval('bufnr("$")'))
eq('', nvim_eval('bufname(1)'))
eq(testfilename, nvim_eval('bufname(2)'))
eq(testfilename_2, nvim_eval('bufname(3)'))
end)
- it('does not restore buffer list without % in &viminfo', function()
- set_additional_cmd('set viminfo+=%')
+ it('does not restore buffer list without % in &shada', function()
+ set_additional_cmd('set shada+=%')
reset()
nvim_command('edit ' .. testfilename)
nvim_command('edit ' .. testfilename_2)
- -- nvim_command('redir! > /tmp/vistr | verbose set viminfo? | redir END')
- -- nvim_command('wviminfo /tmp/foo')
+ -- nvim_command('redir! > /tmp/vistr | verbose set shada? | redir END')
+ -- nvim_command('wshada /tmp/foo')
set_additional_cmd('')
nvim_command('qall')
reset()
- -- nvim_command('call writefile([&viminfo], "/tmp/vistr")')
+ -- nvim_command('call writefile([&shada], "/tmp/vistr")')
eq(1, nvim_eval('bufnr("$")'))
eq('', nvim_eval('bufname(1)'))
end)
- it('does not dump buffer list without % in &viminfo', function()
+ it('does not dump buffer list without % in &shada', function()
nvim_command('edit ' .. testfilename)
nvim_command('edit ' .. testfilename_2)
- -- nvim_command('redir! > /tmp/vistr | verbose set viminfo? | redir END')
- -- nvim_command('wviminfo /tmp/foo')
- set_additional_cmd('set viminfo+=%')
+ -- nvim_command('redir! > /tmp/vistr | verbose set shada? | redir END')
+ -- nvim_command('wshada /tmp/foo')
+ set_additional_cmd('set shada+=%')
nvim_command('qall')
reset()
- -- nvim_command('call writefile([&viminfo], "/tmp/vistr")')
+ -- nvim_command('call writefile([&shada], "/tmp/vistr")')
eq(1, nvim_eval('bufnr("$")'))
eq('', nvim_eval('bufname(1)'))
end)
diff --git a/test/functional/shada/history_spec.lua b/test/functional/shada/history_spec.lua
index 5a7db2bfa6..595938bfb2 100644
--- a/test/functional/shada/history_spec.lua
+++ b/test/functional/shada/history_spec.lua
@@ -13,23 +13,23 @@ describe('ShaDa support code', function()
after_each(clear)
it('is able to dump and read back command-line history', function()
- nvim_command('set viminfo=\'0')
+ nvim_command('set shada=\'0')
nvim_feed(':" Test\n')
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
- nvim_command('set viminfo=\'0')
- nvim_command('rviminfo')
+ nvim_command('set shada=\'0')
+ nvim_command('rshada')
eq('" Test', nvim_eval('histget(":", -1)'))
end)
it('is able to dump and read back 2 items in command-line history', function()
- nvim_command('set viminfo=\'0 history=2')
+ nvim_command('set shada=\'0 history=2')
nvim_feed(':" Test\n')
nvim_feed(':" Test 2\n')
nvim_command('qall')
reset()
- nvim_command('set viminfo=\'0 history=2')
- nvim_command('rviminfo')
+ nvim_command('set shada=\'0 history=2')
+ nvim_command('rshada')
eq('" Test 2', nvim_eval('histget(":", -1)'))
eq('" Test', nvim_eval('histget(":", -2)'))
nvim_command('qall')
@@ -37,50 +37,50 @@ describe('ShaDa support code', function()
it('respects &history when dumping',
function()
- nvim_command('set viminfo=\'0 history=1')
+ nvim_command('set shada=\'0 history=1')
nvim_feed(':" Test\n')
nvim_feed(':" Test 2\n')
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
- nvim_command('set viminfo=\'0 history=2')
- nvim_command('rviminfo')
+ nvim_command('set shada=\'0 history=2')
+ nvim_command('rshada')
eq('" Test 2', nvim_eval('histget(":", -1)'))
eq('', nvim_eval('histget(":", -2)'))
end)
it('respects &history when loading',
function()
- nvim_command('set viminfo=\'0 history=2')
+ nvim_command('set shada=\'0 history=2')
nvim_feed(':" Test\n')
nvim_feed(':" Test 2\n')
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
- nvim_command('set viminfo=\'0 history=1')
- nvim_command('rviminfo')
+ nvim_command('set shada=\'0 history=1')
+ nvim_command('rshada')
eq('" Test 2', nvim_eval('histget(":", -1)'))
eq('', nvim_eval('histget(":", -2)'))
end)
it('dumps only requested amount of command-line history items', function()
- nvim_command('set viminfo=\'0,:1')
+ nvim_command('set shada=\'0,:1')
nvim_feed(':" Test\n')
nvim_feed(':" Test 2\n')
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
- nvim_command('set viminfo=\'0')
- nvim_command('rviminfo')
+ nvim_command('set shada=\'0')
+ nvim_command('rshada')
eq('" Test 2', nvim_eval('histget(":", -1)'))
eq('', nvim_eval('histget(":", -2)'))
end)
- it('does not respect number in &viminfo when loading history', function()
- nvim_command('set viminfo=\'0')
+ it('does not respect number in &shada when loading history', function()
+ nvim_command('set shada=\'0')
nvim_feed(':" Test\n')
nvim_feed(':" Test 2\n')
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
- nvim_command('set viminfo=\'0,:1')
- nvim_command('rviminfo')
+ nvim_command('set shada=\'0,:1')
+ nvim_command('rshada')
eq('" Test 2', nvim_eval('histget(":", -1)'))
eq('" Test', nvim_eval('histget(":", -2)'))
end)
@@ -93,9 +93,9 @@ describe('ShaDa support code', function()
nvim_feed('/Test\n') -- Search history
nvim_feed(':" Test\n') -- Command-line history
nvim_command('0debuggreedy')
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
- nvim_command('rviminfo')
+ nvim_command('rshada')
eq('" Test', nvim_eval('histget(":", -1)'))
eq('Test', nvim_eval('histget("/", -1)'))
eq('"Test"', nvim_eval('histget("=", -1)'))
@@ -107,7 +107,7 @@ describe('ShaDa support code', function()
nvim_eval('setline(".", ["foo", "bar"])')
nvim_feed('gg0/a/e+1\n')
eq({0, 2, 3, 0}, nvim_eval('getpos(".")'))
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
nvim_eval('setline(".", ["foo", "bar"])')
nvim_feed('gg0n')
@@ -118,7 +118,7 @@ describe('ShaDa support code', function()
nvim_eval('setline(".", ["foo", "bar"])')
nvim_command('%s/f/g/g')
eq('goo', nvim_eval('getline(1)'))
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
nvim_eval('setline(".", ["foo", "bar"])')
nvim_command('&')
@@ -241,7 +241,7 @@ describe('ShaDa support code', function()
reset()
-- \171 is U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK in latin1
nvim_command('silent! /\171/')
- nvim_command('set viminfo+=/0')
+ nvim_command('set shada+=/0')
nvim_command('qall!')
reset()
nvim_eval('setline(".", ["\171«"])')
@@ -256,7 +256,7 @@ describe('ShaDa support code', function()
reset()
-- \171 is U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK in latin1
nvim_command('silent! /\171/')
- nvim_command('set viminfo+=/0')
+ nvim_command('set shada+=/0')
set_additional_cmd('')
nvim_command('qall')
reset()
@@ -270,7 +270,7 @@ describe('ShaDa support code', function()
function()
-- \171 is U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK in latin1
nvim_command('silent! /«/')
- nvim_command('set viminfo+=/0')
+ nvim_command('set shada+=/0')
set_additional_cmd('set encoding=latin1')
nvim_command('qall')
reset()
diff --git a/test/functional/shada/marks_spec.lua b/test/functional/shada/marks_spec.lua
index 25362b406b..b69477b6ed 100644
--- a/test/functional/shada/marks_spec.lua
+++ b/test/functional/shada/marks_spec.lua
@@ -38,9 +38,9 @@ describe('ShaDa support code', function()
nvim_command('mark A')
nvim_command('2')
nvim_command('kB')
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
- nvim_command('rviminfo')
+ nvim_command('rshada')
nvim_command('normal! `A')
eq(testfilename, nvim_eval('fnamemodify(@%, ":t")'))
eq(1, nvim_current_line())
@@ -48,13 +48,13 @@ describe('ShaDa support code', function()
eq(2, nvim_current_line())
end)
- it('does not dump global mark with `f0` in viminfo', function()
- nvim_command('set viminfo+=f0')
+ it('does not dump global mark with `f0` in shada', function()
+ nvim_command('set shada+=f0')
nvim_command('edit ' .. testfilename)
nvim_command('mark A')
nvim_command('2')
nvim_command('kB')
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
nvim_command('language C')
nvim_command([[
@@ -66,13 +66,13 @@ describe('ShaDa support code', function()
eq('Vim(normal):E20: Mark not set', nvim('get_var', 'exception'))
end)
- it('does read back global mark even with `\'0` and `f0` in viminfo', function()
+ it('does read back global mark even with `\'0` and `f0` in shada', function()
nvim_command('edit ' .. testfilename)
nvim_command('mark A')
nvim_command('2')
nvim_command('kB')
- nvim_command('wviminfo')
- set_additional_cmd('set viminfo=\'0,f0')
+ nvim_command('wshada')
+ set_additional_cmd('set shada=\'0,f0')
reset()
nvim_command('language C')
nvim_command('normal! `A')
@@ -103,7 +103,7 @@ describe('ShaDa support code', function()
nvim_feed('G')
nvim_feed('gg')
-- nvim_command('redir! >/tmp/jumps.last | jumps | redir END')
- -- nvim_command('wviminfo /tmp/foo')
+ -- nvim_command('wshada /tmp/foo')
nvim_command('qall')
reset()
nvim_command('redraw')
@@ -140,7 +140,7 @@ describe('ShaDa support code', function()
nvim_command('sleep 2')
nvim_feed('gg')
-- nvim_command('redir! >/tmp/jumps.last | jumps | redir END')
- -- nvim_command('wviminfo /tmp/foo')
+ -- nvim_command('wshada /tmp/foo')
nvim_command('qall')
reset()
nvim_command('redraw')
@@ -170,7 +170,7 @@ describe('ShaDa support code', function()
nvim_command('qall!')
reset()
nvim_command('edit ' .. testfilename)
- -- nvim_command('rviminfo')
+ -- nvim_command('rshada')
-- nvim_command('redir! >/tmp/changes | changes | redir END')
nvim_feed('Gg;')
-- Note: without “sync” “commands” test has good changes to fail for unknown
diff --git a/test/functional/shada/registers_spec.lua b/test/functional/shada/registers_spec.lua
index 7efb100cd6..67b0661151 100644
--- a/test/functional/shada/registers_spec.lua
+++ b/test/functional/shada/registers_spec.lua
@@ -48,7 +48,7 @@ describe('ShaDa support code', function()
end)
it('does not dump registers with zero <', function()
- nvim_command('set viminfo=\'0,<0')
+ nvim_command('set shada=\'0,<0')
setreg('c', {'d', 'e', ''}, 'c')
setreg('l', {'a', 'b', 'cde'}, 'l')
setreg('b', {'bca', 'abc', 'cba'}, 'b3')
@@ -63,7 +63,7 @@ describe('ShaDa support code', function()
setreg('c', {'d', 'e', ''}, 'c')
setreg('l', {'a', 'b', 'cde'}, 'l')
setreg('b', {'bca', 'abc', 'cba'}, 'b3')
- set_additional_cmd('set viminfo=\'0,<0')
+ set_additional_cmd('set shada=\'0,<0')
nvim_command('qa')
reset()
eq({{'d', 'e', ''}, 'v'}, getreg('c'))
@@ -72,7 +72,7 @@ describe('ShaDa support code', function()
end)
it('does not dump registers with zero "', function()
- nvim_command('set viminfo=\'0,\\"0')
+ nvim_command('set shada=\'0,\\"0')
setreg('c', {'d', 'e', ''}, 'c')
setreg('l', {'a', 'b', 'cde'}, 'l')
setreg('b', {'bca', 'abc', 'cba'}, 'b3')
@@ -87,7 +87,7 @@ describe('ShaDa support code', function()
setreg('c', {'d', 'e', ''}, 'c')
setreg('l', {'a', 'b', 'cde'}, 'l')
setreg('b', {'bca', 'abc', 'cba'}, 'b3')
- set_additional_cmd('set viminfo=\'0,\\"0')
+ set_additional_cmd('set shada=\'0,\\"0')
nvim_command('qa')
reset()
eq({{'d', 'e', ''}, 'v'}, getreg('c'))
@@ -96,7 +96,7 @@ describe('ShaDa support code', function()
end)
it('does dump registers with zero ", but non-zero <', function()
- nvim_command('set viminfo=\'0,\\"0,<50')
+ nvim_command('set shada=\'0,\\"0,<50')
setreg('c', {'d', 'e', ''}, 'c')
setreg('l', {'a', 'b', 'cde'}, 'l')
setreg('b', {'bca', 'abc', 'cba'}, 'b3')
@@ -108,7 +108,7 @@ describe('ShaDa support code', function()
end)
it('does limit number of lines according to <', function()
- nvim_command('set viminfo=\'0,<2')
+ nvim_command('set shada=\'0,<2')
setreg('o', {'d'}, 'c')
setreg('t', {'a', 'b', 'cde'}, 'l')
nvim_command('qa')
@@ -118,7 +118,7 @@ describe('ShaDa support code', function()
end)
it('does limit number of lines according to "', function()
- nvim_command('set viminfo=\'0,\\"2')
+ nvim_command('set shada=\'0,\\"2')
setreg('o', {'d'}, 'c')
setreg('t', {'a', 'b', 'cde'}, 'l')
nvim_command('qa')
@@ -128,7 +128,7 @@ describe('ShaDa support code', function()
end)
it('does limit number of lines according to < rather then "', function()
- nvim_command('set viminfo=\'0,\\"2,<3')
+ nvim_command('set shada=\'0,\\"2,<3')
setreg('o', {'d'}, 'c')
setreg('t', {'a', 'b', 'cde'}, 'l')
setreg('h', {'abc', 'acb', 'bac', 'bca', 'cab', 'cba'}, 'b3')
diff --git a/test/functional/shada/variables_spec.lua b/test/functional/shada/variables_spec.lua
index 0ffa524238..c2fa25bcb1 100644
--- a/test/functional/shada/variables_spec.lua
+++ b/test/functional/shada/variables_spec.lua
@@ -14,21 +14,21 @@ describe('ShaDa support code', function()
it('is able to dump and read back string variable', function()
nvim('set_var', 'STRVAR', 'foo')
- nvim_command('set viminfo+=!')
- nvim_command('wviminfo')
+ nvim_command('set shada+=!')
+ nvim_command('wshada')
reset()
- nvim_command('set viminfo+=!')
- nvim_command('rviminfo')
+ nvim_command('set shada+=!')
+ nvim_command('rshada')
eq('foo', nvim('get_var', 'STRVAR'))
end)
local autotest = function(tname, varname, varval)
it('is able to dump and read back ' .. tname .. ' variable automatically',
function()
- set_additional_cmd('set viminfo+=!')
+ set_additional_cmd('set shada+=!')
reset()
nvim('set_var', varname, varval)
- -- Exit during `reset` is not a regular exit: it does not write viminfo
+ -- Exit during `reset` is not a regular exit: it does not write shada
-- automatically
nvim_command('qall')
reset()
@@ -42,43 +42,43 @@ describe('ShaDa support code', function()
autotest('dictionary', 'DCTVAR', {a=10})
autotest('list', 'LSTVAR', {{a=10}, {b=10.5}, {c='str'}})
- it('does not read back variables without `!` in &viminfo', function()
+ it('does not read back variables without `!` in &shada', function()
nvim('set_var', 'STRVAR', 'foo')
- nvim_command('set viminfo+=!')
- nvim_command('wviminfo')
- set_additional_cmd('set viminfo-=!')
+ nvim_command('set shada+=!')
+ nvim_command('wshada')
+ set_additional_cmd('set shada-=!')
reset()
- nvim_command('rviminfo')
+ nvim_command('rshada')
eq(0, nvim_eval('exists("g:STRVAR")'))
end)
- it('does not dump variables without `!` in &viminfo', function()
- nvim_command('set viminfo-=!')
+ it('does not dump variables without `!` in &shada', function()
+ nvim_command('set shada-=!')
nvim('set_var', 'STRVAR', 'foo')
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
- nvim_command('set viminfo+=!')
- nvim_command('rviminfo')
+ nvim_command('set shada+=!')
+ nvim_command('rshada')
eq(0, nvim_eval('exists("g:STRVAR")'))
end)
it('does not dump session variables', function()
- nvim_command('set viminfo+=!')
+ nvim_command('set shada+=!')
nvim('set_var', 'StrVar', 'foo')
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
- nvim_command('set viminfo+=!')
- nvim_command('rviminfo')
+ nvim_command('set shada+=!')
+ nvim_command('rshada')
eq(0, nvim_eval('exists("g:StrVar")'))
end)
it('does not dump regular variables', function()
- nvim_command('set viminfo+=!')
+ nvim_command('set shada+=!')
nvim('set_var', 'str_var', 'foo')
- nvim_command('wviminfo')
+ nvim_command('wshada')
reset()
- nvim_command('set viminfo+=!')
- nvim_command('rviminfo')
+ nvim_command('set shada+=!')
+ nvim_command('rshada')
eq(0, nvim_eval('exists("g:str_var")'))
end)