From 652ee0348cbbdfe4b1ecc7c3437ce4b45257254b Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Tue, 30 Jun 2015 14:11:44 +0200 Subject: [PATCH] tests: Use write_file() in source(). --- test/functional/helpers.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index db2122565b..33d04616a0 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -217,10 +217,7 @@ end local function source(code) local tmpname = os.tmpname() - local tmpfile = io.open(tmpname, "w") - tmpfile:write(code) - tmpfile:flush() - tmpfile:close() + write_file(tmpname, code) nvim_command('source '..tmpname) os.remove(tmpname) end