aboutsummaryrefslogtreecommitdiff
path: root/test/functional/shada
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/shada')
-rw-r--r--test/functional/shada/compatibility_spec.lua2
-rw-r--r--test/functional/shada/merging_spec.lua2
-rw-r--r--test/functional/shada/shada_spec.lua13
3 files changed, 14 insertions, 3 deletions
diff --git a/test/functional/shada/compatibility_spec.lua b/test/functional/shada/compatibility_spec.lua
index a5ef60d91f..fb656735dd 100644
--- a/test/functional/shada/compatibility_spec.lua
+++ b/test/functional/shada/compatibility_spec.lua
@@ -12,7 +12,7 @@ local wshada, sdrcmd, shada_fname = get_shada_rw('Xtest-functional-shada-compati
local mock_file_path = '/a/b/'
local mock_file_path2 = '/d/e/'
-if helpers.iswin() then
+if helpers.is_os('win') then
mock_file_path = 'C:/a/'
mock_file_path2 = 'C:/d/'
end
diff --git a/test/functional/shada/merging_spec.lua b/test/functional/shada/merging_spec.lua
index 2d44b0a950..da2fbbe029 100644
--- a/test/functional/shada/merging_spec.lua
+++ b/test/functional/shada/merging_spec.lua
@@ -14,7 +14,7 @@ local wshada, sdrcmd, shada_fname =
get_shada_rw('Xtest-functional-shada-merging.shada')
local mock_file_path = '/a/b/'
-if helpers.iswin() then
+if helpers.is_os('win') then
mock_file_path = 'C:/a/'
end
diff --git a/test/functional/shada/shada_spec.lua b/test/functional/shada/shada_spec.lua
index d10a2facbb..88a99d9b55 100644
--- a/test/functional/shada/shada_spec.lua
+++ b/test/functional/shada/shada_spec.lua
@@ -5,6 +5,8 @@ local meths, nvim_command, funcs, eq =
local write_file, spawn, set_session, nvim_prog, exc_exec =
helpers.write_file, helpers.spawn, helpers.set_session, helpers.nvim_prog,
helpers.exc_exec
+local is_os = helpers.is_os
+local skip = helpers.skip
local lfs = require('lfs')
local paths = require('test.cmakeconfig.paths')
@@ -238,8 +240,17 @@ describe('ShaDa support code', function()
eq('', meths.get_option('shada'))
end)
+ it('setting &shada gives proper error message on missing number', function()
+ eq([[Vim(set):E526: Missing number after <">: shada="]],
+ exc_exec([[set shada=\"]]))
+ for _, c in ipairs({"'", "/", ":", "<", "@", "s"}) do
+ eq(([[Vim(set):E526: Missing number after <%s>: shada=%s]]):format(c, c),
+ exc_exec(([[set shada=%s]]):format(c)))
+ end
+ end)
+
it('does not crash when ShaDa file directory is not writable', function()
- if helpers.pending_win32(pending) then return end
+ skip(is_os('win'))
funcs.mkdir(dirname, '', 0)
eq(0, funcs.filewritable(dirname))