aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorwatiko <service@mail.watiko.net>2015-12-30 19:14:33 +0900
committerwatiko <service@mail.watiko.net>2016-01-10 10:44:57 +0900
commit59b04d856b869204eec3ebc73a99b055734679b8 (patch)
tree38ceeb0bfb491d2ca1067c0b678252efdcfb3657 /test/functional/helpers.lua
parentfeed81f45f1c9fa52e54f4a6168391dac6200066 (diff)
downloadrneovim-59b04d856b869204eec3ebc73a99b055734679b8.tar.gz
rneovim-59b04d856b869204eec3ebc73a99b055734679b8.tar.bz2
rneovim-59b04d856b869204eec3ebc73a99b055734679b8.zip
tests: Make helper.source() return tempname.
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 50fa3fb1bd..1fba15c2c3 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -1,4 +1,5 @@
require('coxpcall')
+local ffi = require('ffi')
local lfs = require('lfs')
local assert = require('luassert')
local Loop = require('nvim.loop')
@@ -246,9 +247,13 @@ end
local function source(code)
local tmpname = os.tmpname()
+ if ffi.os == 'OSX' and string.match(tmpname, '^/tmp') then
+ tmpname = '/private'..tmpname
+ end
write_file(tmpname, code)
nvim_command('source '..tmpname)
os.remove(tmpname)
+ return tmpname
end
local function eq(expected, actual)