vim-patch:9.0.0537: the do_set() function is much too long (#20274)

Problem:    The do_set() function is much too long.
Solution:   Move setting of a string option to a separate function.
4740394f23

Cherry-pick some tests from Vim patch 8.2.0540.
This commit is contained in:
zeertzjq
2022-09-22 09:43:37 +08:00
committed by GitHub
parent b4b05f160d
commit 71e70d0c99
3 changed files with 466 additions and 362 deletions

View File

@@ -238,6 +238,15 @@ 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