mirror of
https://github.com/neovim/neovim.git
synced 2025-11-23 18:46:38 +00:00
tests: Fix OSX's tempname issue.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
local ffi = require('ffi')
|
||||||
local helpers = require('test.functional.helpers')
|
local helpers = require('test.functional.helpers')
|
||||||
local nvim, call = helpers.meths, helpers.call
|
local nvim, call = helpers.meths, helpers.call
|
||||||
local clear, eq = helpers.clear, helpers.eq
|
local clear, eq = helpers.clear, helpers.eq
|
||||||
@@ -13,6 +14,11 @@ end
|
|||||||
|
|
||||||
local function source(code)
|
local function source(code)
|
||||||
local tmpname = os.tmpname()
|
local tmpname = os.tmpname()
|
||||||
|
|
||||||
|
if ffi.os == 'OSX' and string.match(tmpname, '^/tmp') then
|
||||||
|
tmpname = '/private'..tmpname
|
||||||
|
end
|
||||||
|
|
||||||
write_file(tmpname, code)
|
write_file(tmpname, code)
|
||||||
nvim.command('source '..tmpname)
|
nvim.command('source '..tmpname)
|
||||||
os.remove(tmpname)
|
os.remove(tmpname)
|
||||||
|
|||||||
Reference in New Issue
Block a user