From e0332e7f7c058baa2c25a495db332d2d028dd041 Mon Sep 17 00:00:00 2001 From: Rainer Borene Date: Tue, 11 Nov 2014 07:12:19 -0200 Subject: legacy tests: implement :source helper method. --- test/functional/helpers.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/functional/helpers.lua') diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 6c3f5190c9..2c08fb7818 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -182,6 +182,16 @@ local function execute(...) end end +local function source(code) + local tmpname = os.tmpname() + local tmpfile = io.open(tmpname, "w") + tmpfile:write(code) + tmpfile:flush() + tmpfile:close() + nvim_command('source '..tmpname) + os.remove(tmpname) +end + local function eq(expected, actual) return assert.are.same(expected, actual) end @@ -247,6 +257,7 @@ clear() return { clear = clear, dedent = dedent, + source = source, rawfeed = rawfeed, insert = insert, feed = feed, -- cgit