diff options
author | dundargoc <gocdundar@gmail.com> | 2024-04-08 11:03:20 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-04-08 22:51:00 +0200 |
commit | 7035125b2b26aa68fcfb7cda39377ac79926a0f9 (patch) | |
tree | d194a3556a367b42505f9e7d26637e7cb3674928 /test/functional/lua/loader_spec.lua | |
parent | 978962f9a00ce75216d2c36b79397ef3d2b54096 (diff) | |
download | rneovim-7035125b2b26aa68fcfb7cda39377ac79926a0f9.tar.gz rneovim-7035125b2b26aa68fcfb7cda39377ac79926a0f9.tar.bz2 rneovim-7035125b2b26aa68fcfb7cda39377ac79926a0f9.zip |
test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
Diffstat (limited to 'test/functional/lua/loader_spec.lua')
-rw-r--r-- | test/functional/lua/loader_spec.lua | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/test/functional/lua/loader_spec.lua b/test/functional/lua/loader_spec.lua index 6f74385e45..89be7a4c09 100644 --- a/test/functional/lua/loader_spec.lua +++ b/test/functional/lua/loader_spec.lua @@ -1,10 +1,10 @@ -- Test suite for testing interactions with API bindings -local helpers = require('test.functional.helpers')(after_each) +local t = require('test.functional.testutil')(after_each) -local exec_lua = helpers.exec_lua -local command = helpers.command -local clear = helpers.clear -local eq = helpers.eq +local exec_lua = t.exec_lua +local command = t.command +local clear = t.clear +local eq = t.eq describe('vim.loader', function() before_each(clear) @@ -35,7 +35,7 @@ describe('vim.loader', function() vim.loader.enable() ]] - local tmp = helpers.tmpname() + local tmp = t.tmpname() command('edit ' .. tmp) eq( @@ -73,15 +73,15 @@ describe('vim.loader', function() vim.loader.enable() ]] - local t = helpers.tmpname() - assert(os.remove(t)) - assert(helpers.mkdir(t)) - assert(helpers.mkdir(t .. '/%')) - local tmp1 = t .. '/%/x' - local tmp2 = t .. '/%%x' + local tmp = t.tmpname() + assert(os.remove(tmp)) + assert(t.mkdir(tmp)) + assert(t.mkdir(tmp .. '/%')) + local tmp1 = tmp .. '/%/x' + local tmp2 = tmp .. '/%%x' - helpers.write_file(tmp1, 'return 1', true) - helpers.write_file(tmp2, 'return 2', true) + t.write_file(tmp1, 'return 1', true) + t.write_file(tmp2, 'return 2', true) vim.uv.fs_utime(tmp1, 0, 0) vim.uv.fs_utime(tmp2, 0, 0) eq(1, exec_lua('return loadfile(...)()', tmp1)) |