diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
commit | ff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch) | |
tree | 729bbcb92231538fa61dab6c3d890b025484b7f5 /test/unit/tempfile_spec.lua | |
parent | 376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff) | |
parent | 28c04948a1c887a1cc0cb64de79fa32631700466 (diff) | |
download | rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2 rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/unit/tempfile_spec.lua')
-rw-r--r-- | test/unit/tempfile_spec.lua | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/unit/tempfile_spec.lua b/test/unit/tempfile_spec.lua index e35490a561..1a42eed17e 100644 --- a/test/unit/tempfile_spec.lua +++ b/test/unit/tempfile_spec.lua @@ -1,11 +1,11 @@ -local helpers = require('test.unit.helpers')(after_each) -local itp = helpers.gen_itp(it) +local t = require('test.unit.testutil') +local itp = t.gen_itp(it) -local eq = helpers.eq -local neq = helpers.neq -local cimport = helpers.cimport -local child_call_once = helpers.child_call_once -local child_cleanup_once = helpers.child_cleanup_once +local eq = t.eq +local neq = t.neq +local cimport = t.cimport +local child_call_once = t.child_call_once +local child_cleanup_once = t.child_cleanup_once local lib = cimport('./src/nvim/os/os.h', './src/nvim/fileio.h') @@ -19,7 +19,7 @@ describe('tempfile related functions', function() end) local vim_gettempdir = function() - return helpers.ffi.string(lib.vim_gettempdir()) + return t.ffi.string(lib.vim_gettempdir()) end describe('vim_gettempdir', function() @@ -28,7 +28,7 @@ describe('tempfile related functions', function() assert.True(dir ~= nil and dir:len() > 0) -- os_file_is_writable returns 2 for a directory which we have rights -- to write into. - eq(lib.os_file_is_writable(helpers.to_cstr(dir)), 2) + eq(2, lib.os_file_is_writable(t.to_cstr(dir))) for entry in vim.fs.dir(dir) do assert.True(entry == '.' or entry == '..') end @@ -41,7 +41,7 @@ describe('tempfile related functions', function() describe('vim_tempname', function() local vim_tempname = function() - return helpers.ffi.string(lib.vim_tempname()) + return t.ffi.string(lib.vim_tempname()) end itp('generate name of non-existing file', function() @@ -57,7 +57,7 @@ describe('tempfile related functions', function() itp('generate file name in Nvim own temp directory', function() local dir = vim_gettempdir() local file = vim_tempname() - eq(string.sub(file, 1, string.len(dir)), dir) + eq(dir, string.sub(file, 1, string.len(dir))) end) end) end) |