mirror of
https://github.com/neovim/neovim.git
synced 2026-04-20 22:35:33 +00:00
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
This commit is contained in:
@@ -13,7 +13,7 @@ describe('vim_* functions', function()
|
||||
|
||||
describe('command', function()
|
||||
it('works', function()
|
||||
local fname = os.tmpname()
|
||||
local fname = helpers.tmpname()
|
||||
nvim('command', 'new')
|
||||
nvim('command', 'edit '..fname)
|
||||
nvim('command', 'normal itesting\napi')
|
||||
|
||||
Reference in New Issue
Block a user