diff options
author | ZyX <kp-pav@yandex.ru> | 2015-07-26 01:52:50 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2015-10-08 22:00:15 +0300 |
commit | e2994a3c62265a26a632ed7cd4d11ce4fb711586 (patch) | |
tree | dbc0d392d00e93b7bdd4e7a592bfaa6118bf2d2d /test/functional/helpers.lua | |
parent | b7ca976f730b4648d4f1cf48ea894ee0a8ae8e72 (diff) | |
download | rneovim-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/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index a6f4f7c2e5..23581ba4d2 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -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 |