aboutsummaryrefslogtreecommitdiff
path: root/test/functional/shada/marks_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2015-07-26 01:52:50 +0300
committerZyX <kp-pav@yandex.ru>2015-10-08 22:00:15 +0300
commite2994a3c62265a26a632ed7cd4d11ce4fb711586 (patch)
treedbc0d392d00e93b7bdd4e7a592bfaa6118bf2d2d /test/functional/shada/marks_spec.lua
parentb7ca976f730b4648d4f1cf48ea894ee0a8ae8e72 (diff)
downloadrneovim-e2994a3c62265a26a632ed7cd4d11ce4fb711586.tar.gz
rneovim-e2994a3c62265a26a632ed7cd4d11ce4fb711586.tar.bz2
rneovim-e2994a3c62265a26a632ed7cd4d11ce4fb711586.zip
shada,functests: Test how ShaDa support code reacts on errors
Some notes: - Replaced msgpack_unpacker usage with regular xmalloc’ed buffer. Also since msgpack_unpack_next (as well as msgpack_unpacker_next) is not ever going to return MSGPACK_UNPACK_EXTRA_BYTES this condition was checked manually. Function that does return this status is msgpack_unpack, but it is marked as obsolete. - Zero type is checked prior to main switch in shada_read_next_item because otherwise check would be skipped. - Zeroing entry at the start of shada_read_next_item makes it safer. - dedent('') does not work. - v:oldfiles list is only replaced with bang, if it is NULL or empty.
Diffstat (limited to 'test/functional/shada/marks_spec.lua')
-rw-r--r--test/functional/shada/marks_spec.lua12
1 files changed, 3 insertions, 9 deletions
diff --git a/test/functional/shada/marks_spec.lua b/test/functional/shada/marks_spec.lua
index 4909ae608e..341ca2d647 100644
--- a/test/functional/shada/marks_spec.lua
+++ b/test/functional/shada/marks_spec.lua
@@ -5,9 +5,9 @@ local nvim, nvim_window, nvim_curwin, nvim_command, nvim_feed, nvim_eval, eq =
helpers.eval, helpers.eq
local shada_helpers = require('test.functional.shada.helpers')
-local reset, set_additional_cmd, clear =
+local reset, set_additional_cmd, clear, exc_exec =
shada_helpers.reset, shada_helpers.set_additional_cmd,
- shada_helpers.clear
+ shada_helpers.clear, shada_helpers.exc_exec
local nvim_current_line = function()
return nvim_window('get_cursor', nvim_curwin())[1]
@@ -57,13 +57,7 @@ describe('ShaDa support code', function()
nvim_command('wshada')
reset()
nvim_command('language C')
- nvim_command([[
- try
- execute "normal! `A"
- catch
- let exception = v:exception
- endtry]])
- eq('Vim(normal):E20: Mark not set', nvim('get_var', 'exception'))
+ eq('Vim(normal):E20: Mark not set', exc_exec('normal! `A'))
end)
it('does read back global mark even with `\'0` and `f0` in shada', function()