mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
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.
This commit is contained in:
@@ -220,9 +220,12 @@ local function execute(...)
|
||||
end
|
||||
|
||||
-- Dedent the given text and write it to the file name.
|
||||
local function write_file(name, text)
|
||||
local function write_file(name, text, dont_dedent)
|
||||
local file = io.open(name, 'w')
|
||||
file:write(dedent(text))
|
||||
if not dont_dedent then
|
||||
text = dedent(text)
|
||||
end
|
||||
file:write(text)
|
||||
file:flush()
|
||||
file:close()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user