aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2018-04-01 20:04:35 +0300
committerZyX <kp-pav@yandex.ru>2018-04-01 20:04:35 +0300
commit1ac1f520f02afc934523ce76a99a3d17d0d6a670 (patch)
tree3e5309a7eff3f312965f00556f535ab8264fbc77
parent3df11cfbca3dc037974eb6c61d8f9413b3b7ca9c (diff)
downloadrneovim-1ac1f520f02afc934523ce76a99a3d17d0d6a670.tar.gz
rneovim-1ac1f520f02afc934523ce76a99a3d17d0d6a670.tar.bz2
rneovim-1ac1f520f02afc934523ce76a99a3d17d0d6a670.zip
functests: Add test for merging with file with only numeric mark
Known to cause memory leak, but not an expected crash.
-rw-r--r--test/functional/shada/merging_spec.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/shada/merging_spec.lua b/test/functional/shada/merging_spec.lua
index 1a289a2de7..5d486bbd93 100644
--- a/test/functional/shada/merging_spec.lua
+++ b/test/functional/shada/merging_spec.lua
@@ -525,6 +525,22 @@ describe('ShaDa marks support code', function()
eq('-', funcs.fnamemodify(curbufmeths.get_name(), ':t'))
end)
+ it('can merge with file with mark 9 as the only numeric mark', function()
+ wshada('\007\001\018\131\162mX\195\161f\196\006' .. mock_file_path .. '-\161n9')
+ eq(0, exc_exec(sdrcmd()))
+ nvim_command('normal! `9oabc')
+ eq('-', funcs.fnamemodify(curbufmeths.get_name(), ':t'))
+ eq(0, exc_exec('wshada ' .. shada_fname))
+ local found = {}
+ for _, v in ipairs(read_shada_file(shada_fname)) do
+ if v.type == 7 and v.value.f == mock_file_path .. '-' then
+ local name = ('%c'):format(v.value.n)
+ found[name] = (found[name] or 0) + 1
+ end
+ end
+ eq({['0']=1, ['1']=1}, found)
+ end)
+
it('uses last A mark with gt timestamp from file when reading with !',
function()
wshada('\007\001\018\131\162mX\195\161f\196\006' .. mock_file_path .. '-\161nA')