test: tmpname(create:boolean) #30242

Problem:
137f98cf64 added the `create` parameter to `tmpname()` but didn't
fully implement it.

Solution:
- Update impl for the `os.tmpname()` codepath.
- Inspect all usages of `tmpname()`, update various tests.
This commit is contained in:
Justin M. Keyes
2024-09-03 02:18:17 -07:00
committed by GitHub
parent ae9674704a
commit ea2d949351
5 changed files with 9 additions and 8 deletions

View File

@@ -12,7 +12,6 @@ local skip = t.skip
-- events which can happen with some backends on some platforms
local function touch(path)
local tmp = t.tmpname()
io.open(tmp, 'w'):close()
assert(vim.uv.fs_rename(tmp, path))
end
@@ -42,7 +41,7 @@ describe('vim._watch', function()
)
end
local root_dir = vim.uv.fs_mkdtemp(vim.fs.dirname(t.tmpname()) .. '/nvim_XXXXXXXXXX')
local root_dir = vim.uv.fs_mkdtemp(vim.fs.dirname(t.tmpname(false)) .. '/nvim_XXXXXXXXXX')
local expected_events = 0