diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-09-02 19:14:09 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2024-09-02 20:19:50 +0200 |
commit | 137f98cf6428a55b1b7687c151d8481c1deb9347 (patch) | |
tree | 043b7c4cd4d1b0f89352d48b9f6c62ed08b91a9d /test/functional/ex_cmds | |
parent | ef8067a19d981388a14407ea08245811cf5b3604 (diff) | |
download | rneovim-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.lua | 9 |
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) |