diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-20 21:50:53 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-11-20 21:51:00 -0300 |
commit | bc1b9c1d90898a322cf43fd80f225105a5c7a122 (patch) | |
tree | f2b436a97a6c74e8426476cd1c4e7425b944a3ad /test/functional/helpers.lua | |
parent | 2f02f6c53571869e07d175b518d7222093dbb31a (diff) | |
parent | df5a17fb516e28336aeb5094537bc60f6ac717eb (diff) | |
download | rneovim-bc1b9c1d90898a322cf43fd80f225105a5c7a122.tar.gz rneovim-bc1b9c1d90898a322cf43fd80f225105a5c7a122.tar.bz2 rneovim-bc1b9c1d90898a322cf43fd80f225105a5c7a122.zip |
Merge PR #1420 'Migrate legacy tests (2nd batch)'
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 11 |
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, |