diff options
Diffstat (limited to 'test/functional/legacy/012_directory_spec.lua')
-rw-r--r-- | test/functional/legacy/012_directory_spec.lua | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test/functional/legacy/012_directory_spec.lua b/test/functional/legacy/012_directory_spec.lua index dd207ca0b4..050e3855fe 100644 --- a/test/functional/legacy/012_directory_spec.lua +++ b/test/functional/legacy/012_directory_spec.lua @@ -4,7 +4,7 @@ -- - "dir", in directory relative to current dir local helpers = require('test.functional.helpers')(after_each) -local lfs = require('lfs') +local luv = require('luv') local eq = helpers.eq local neq = helpers.neq @@ -17,10 +17,11 @@ local command = helpers.command local write_file = helpers.write_file local curbufmeths = helpers.curbufmeths local expect_exit = helpers.expect_exit +local mkdir = helpers.mkdir local function ls_dir_sorted(dirname) local files = {} - for f in lfs.dir(dirname) do + for f in vim.fs.dir(dirname) do if f ~= "." and f~= ".." then table.insert(files, f) end @@ -38,8 +39,8 @@ describe("'directory' option", function() end of testfile ]] write_file('Xtest1', text) - lfs.mkdir('Xtest.je') - lfs.mkdir('Xtest2') + mkdir('Xtest.je') + mkdir('Xtest2') write_file('Xtest2/Xtest3', text) clear() end) @@ -62,21 +63,21 @@ describe("'directory' option", function() meths.set_option('directory', '.') -- sanity check: files should not exist yet. - eq(nil, lfs.attributes('.Xtest1.swp')) + eq(nil, luv.fs_stat('.Xtest1.swp')) command('edit! Xtest1') poke_eventloop() eq('Xtest1', funcs.buffer_name('%')) -- Verify that the swapfile exists. In the legacy test this was done by -- reading the output from :!ls. - neq(nil, lfs.attributes('.Xtest1.swp')) + neq(nil, luv.fs_stat('.Xtest1.swp')) meths.set_option('directory', './Xtest2,.') command('edit Xtest1') poke_eventloop() -- swapfile should no longer exist in CWD. - eq(nil, lfs.attributes('.Xtest1.swp')) + eq(nil, luv.fs_stat('.Xtest1.swp')) eq({ "Xtest1.swp", "Xtest3" }, ls_dir_sorted("Xtest2")) |