diff options
Diffstat (limited to 'test/functional/legacy')
-rw-r--r-- | test/functional/legacy/011_autocommands_spec.lua | 6 | ||||
-rw-r--r-- | test/functional/legacy/012_directory_spec.lua | 15 | ||||
-rw-r--r-- | test/functional/legacy/074_global_var_in_viminfo_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/legacy/autochdir_spec.lua | 4 |
4 files changed, 15 insertions, 14 deletions
diff --git a/test/functional/legacy/011_autocommands_spec.lua b/test/functional/legacy/011_autocommands_spec.lua index 7ae851467f..5b6d030567 100644 --- a/test/functional/legacy/011_autocommands_spec.lua +++ b/test/functional/legacy/011_autocommands_spec.lua @@ -13,7 +13,7 @@ -- being modified outside of Vim (noticed on Solaris). local helpers= require('test.functional.helpers')(after_each) -local lfs = require('lfs') +local luv = require('luv') local clear, feed_command, expect, eq, neq, dedent, write_file, feed = helpers.clear, helpers.feed_command, helpers.expect, helpers.eq, helpers.neq, helpers.dedent, helpers.write_file, helpers.feed @@ -31,8 +31,8 @@ local function prepare_gz_file(name, text) -- Compress the file with gzip. command([[call system(['gzip', '--force', ']]..name..[['])]]) -- This should create the .gz file and delete the original. - neq(nil, lfs.attributes(name..'.gz')) - eq(nil, lfs.attributes(name)) + neq(nil, luv.fs_stat(name..'.gz')) + eq(nil, luv.fs_stat(name)) end describe('file reading, writing and bufnew and filter autocommands', function() 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")) diff --git a/test/functional/legacy/074_global_var_in_viminfo_spec.lua b/test/functional/legacy/074_global_var_in_viminfo_spec.lua index 445d742c1f..06d8b276d7 100644 --- a/test/functional/legacy/074_global_var_in_viminfo_spec.lua +++ b/test/functional/legacy/074_global_var_in_viminfo_spec.lua @@ -1,7 +1,7 @@ -- Tests for storing global variables in the .shada file local helpers = require('test.functional.helpers')(after_each) -local lfs = require('lfs') +local luv = require('luv') local clear, command, eq, neq, eval, poke_eventloop = helpers.clear, helpers.command, helpers.eq, helpers.neq, helpers.eval, helpers.poke_eventloop @@ -39,7 +39,7 @@ describe('storing global variables in ShaDa files', function() poke_eventloop() -- Assert that the shada file exists. - neq(nil, lfs.attributes(tempname)) + neq(nil, luv.fs_stat(tempname)) command('unlet MY_GLOBAL_DICT') command('unlet MY_GLOBAL_LIST') -- Assert that the variables where deleted. diff --git a/test/functional/legacy/autochdir_spec.lua b/test/functional/legacy/autochdir_spec.lua index 13cb6cd287..5da54b4850 100644 --- a/test/functional/legacy/autochdir_spec.lua +++ b/test/functional/legacy/autochdir_spec.lua @@ -1,8 +1,8 @@ -local lfs = require('lfs') local helpers = require('test.functional.helpers')(after_each) local clear, eq, matches = helpers.clear, helpers.eq, helpers.matches local eval, command, call, meths = helpers.eval, helpers.command, helpers.call, helpers.meths local source, exec_capture = helpers.source, helpers.exec_capture +local mkdir = helpers.mkdir local function expected_empty() eq({}, meths.get_vvar('errors')) @@ -12,7 +12,7 @@ describe('autochdir behavior', function() local dir = 'Xtest_functional_legacy_autochdir' before_each(function() - lfs.mkdir(dir) + mkdir(dir) clear() command('set shellslash') end) |