aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorRainer Borene <rainerborene@gmail.com>2014-11-11 07:12:19 -0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-11-20 21:06:37 -0300
commite0332e7f7c058baa2c25a495db332d2d028dd041 (patch)
tree175f7ae336a0d00ea9694c677cd54cd1664e9e9a /test/functional/helpers.lua
parent1732615290573d98e8e0221a2f8d600d44c14d10 (diff)
downloadrneovim-e0332e7f7c058baa2c25a495db332d2d028dd041.tar.gz
rneovim-e0332e7f7c058baa2c25a495db332d2d028dd041.tar.bz2
rneovim-e0332e7f7c058baa2c25a495db332d2d028dd041.zip
legacy tests: implement :source helper method.
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua11
1 files changed, 11 insertions, 0 deletions
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,