aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-09-02 19:14:09 +0200
committerJustin M. Keyes <justinkz@gmail.com>2024-09-02 20:19:50 +0200
commit137f98cf6428a55b1b7687c151d8481c1deb9347 (patch)
tree043b7c4cd4d1b0f89352d48b9f6c62ed08b91a9d /test/functional/ex_cmds
parentef8067a19d981388a14407ea08245811cf5b3604 (diff)
downloadrneovim-137f98cf6428a55b1b7687c151d8481c1deb9347.tar.gz
rneovim-137f98cf6428a55b1b7687c151d8481c1deb9347.tar.bz2
rneovim-137f98cf6428a55b1b7687c151d8481c1deb9347.zip
test: tmpname() can skip file creation
Diffstat (limited to 'test/functional/ex_cmds')
-rw-r--r--test/functional/ex_cmds/profile_spec.lua9
1 files changed, 2 insertions, 7 deletions
diff --git a/test/functional/ex_cmds/profile_spec.lua b/test/functional/ex_cmds/profile_spec.lua
index 57e5c6b2dc..365583948b 100644
--- a/test/functional/ex_cmds/profile_spec.lua
+++ b/test/functional/ex_cmds/profile_spec.lua
@@ -6,17 +6,11 @@ require('os')
local eval = n.eval
local command = n.command
local eq, neq = t.eq, t.neq
-local tempfile = t.tmpname()
+local tempfile = t.tmpname(false)
local source = n.source
local matches = t.matches
local read_file = t.read_file
--- tmpname() also creates the file on POSIX systems. Remove it again.
--- We just need the name, ignoring any race conditions.
-if uv.fs_stat(tempfile).uid then
- os.remove(tempfile)
-end
-
local function assert_file_exists(filepath)
neq(nil, uv.fs_stat(filepath).uid)
end
@@ -31,6 +25,7 @@ describe(':profile', function()
after_each(function()
n.expect_exit(command, 'qall!')
if uv.fs_stat(tempfile).uid ~= nil then
+ -- Delete the tempfile. We just need the name, ignoring any race conditions.
os.remove(tempfile)
end
end)