diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2017-12-04 22:28:04 +0100 | 
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2017-12-05 01:46:41 +0100 | 
| commit | 5f288220f93f61b3461814d7b93618fc4d9ab7df (patch) | |
| tree | 76163ec6a56de9d5257f13b6c5e0cc3cab939e23 /test/functional/helpers.lua | |
| parent | 7f386b175c2e0f7b76a6e21e38bbbff2f6083d0c (diff) | |
| download | rneovim-5f288220f93f61b3461814d7b93618fc4d9ab7df.tar.gz rneovim-5f288220f93f61b3461814d7b93618fc4d9ab7df.tar.bz2 rneovim-5f288220f93f61b3461814d7b93618fc4d9ab7df.zip | |
test: write_file(): support append-mode
Diffstat (limited to 'test/functional/helpers.lua')
| -rw-r--r-- | test/functional/helpers.lua | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 1709427d59..f939567693 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -334,8 +334,8 @@ local function feed_command(...)  end  -- Dedent the given text and write it to the file name. -local function write_file(name, text, dont_dedent) -  local file = io.open(name, 'w') +local function write_file(name, text, no_dedent, append) +  local file = io.open(name, (append and 'a' or 'w'))    if type(text) == 'table' then      -- Byte blob      local bytes = text @@ -343,7 +343,7 @@ local function write_file(name, text, dont_dedent)      for _, char in ipairs(bytes) do        text = ('%s%c'):format(text, char)      end -  elseif not dont_dedent then +  elseif not no_dedent then      text = dedent(text)    end    file:write(text) | 
