aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/profile_spec.lua
diff options
context:
space:
mode:
authorRui Abreu Ferreira <raf-ep@gmx.com>2015-12-29 19:18:16 +0000
committerRui Abreu Ferreira <raf-ep@gmx.com>2016-08-31 11:32:28 +0100
commit9ce81f7b2b90846063f6bd4a5ce8efc61e437983 (patch)
tree15a95c9f6f0b0138b9a2f7f3cab087bbe3f6b0f8 /test/functional/ex_cmds/profile_spec.lua
parent39c628d031b89e9048340f6c95b9c3a97c2a0089 (diff)
downloadrneovim-9ce81f7b2b90846063f6bd4a5ce8efc61e437983.tar.gz
rneovim-9ce81f7b2b90846063f6bd4a5ce8efc61e437983.tar.bz2
rneovim-9ce81f7b2b90846063f6bd4a5ce8efc61e437983.zip
functionaltest: Create lua helper for os.tmpname()
In Windows Lua's os.tmpname() returns relative paths starting with \s, prepend them with $TEMP to generate a valid path. In OS X os.tmpname() returns paths in '/tmp' but they should be in '/private/tmp'. We cannot use os_name() for platform detection because some tests use tempname() before nvim is spawned, instead use one of the following: 1. Set SYSTEM_NAME environment variable before calling the tests, it is set from CMAKE_SYSTEM_NAME(i.e. uname -s or 'Windows') 2. Call uname -s 3. Assume windows
Diffstat (limited to 'test/functional/ex_cmds/profile_spec.lua')
-rw-r--r--test/functional/ex_cmds/profile_spec.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/ex_cmds/profile_spec.lua b/test/functional/ex_cmds/profile_spec.lua
index d390806679..f185db192a 100644
--- a/test/functional/ex_cmds/profile_spec.lua
+++ b/test/functional/ex_cmds/profile_spec.lua
@@ -5,9 +5,9 @@ local helpers = require('test.functional.helpers')(after_each)
local eval = helpers.eval
local command = helpers.command
local eq, neq = helpers.eq, helpers.neq
-local tempfile = os.tmpname()
+local tempfile = helpers.tmpname()
--- os.tmpname() also creates the file on POSIX systems. Remove it again.
+-- tmpname() also creates the file on POSIX systems. Remove it again.
-- We just need the name, ignoring any race conditions.
if lfs.attributes(tempfile, 'uid') then
os.remove(tempfile)