mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 10:31:48 +00:00
test: replace lfs with luv and vim.fs
test: replace lfs with luv luv already pretty much does everything lfs does, so this duplication of dependencies isn't needed.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local lfs = require('lfs')
|
||||
local luv = require('luv')
|
||||
local neq, eq, command = helpers.neq, helpers.eq, helpers.command
|
||||
local clear, curbufmeths = helpers.clear, helpers.curbufmeths
|
||||
local exc_exec, expect, eval = helpers.exc_exec, helpers.expect, helpers.eval
|
||||
@@ -118,7 +118,7 @@ describe('eval-API', function()
|
||||
end)
|
||||
|
||||
it('are highlighted by vim.vim syntax file', function()
|
||||
if lfs.attributes("build/runtime/syntax/vim/generated.vim",'uid') == nil then
|
||||
if luv.fs_stat("build/runtime/syntax/vim/generated.vim").uid == nil then
|
||||
pending("runtime was not built, skipping test")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
|
||||
local lfs = require('lfs')
|
||||
local luv = require('luv')
|
||||
|
||||
local eq = helpers.eq
|
||||
local clear = helpers.clear
|
||||
@@ -16,6 +16,7 @@ local curtabmeths = helpers.curtabmeths
|
||||
local get_pathsep = helpers.get_pathsep
|
||||
local rmdir = helpers.rmdir
|
||||
local pcall_err = helpers.pcall_err
|
||||
local mkdir = helpers.mkdir
|
||||
|
||||
local fname = 'Xtest-functional-eval-buf_functions'
|
||||
local fname2 = fname .. '.2'
|
||||
@@ -62,7 +63,7 @@ describe('bufname() function', function()
|
||||
eq('', funcs.bufname('X'))
|
||||
end)
|
||||
before_each(function()
|
||||
lfs.mkdir(dirname)
|
||||
mkdir(dirname)
|
||||
end)
|
||||
after_each(function()
|
||||
rmdir(dirname)
|
||||
@@ -70,7 +71,7 @@ describe('bufname() function', function()
|
||||
it('returns expected buffer name', function()
|
||||
eq('', funcs.bufname('%')) -- Buffer has no name yet
|
||||
command('file ' .. fname)
|
||||
local wd = lfs.currentdir()
|
||||
local wd = luv.cwd()
|
||||
local sep = get_pathsep()
|
||||
local curdirname = funcs.fnamemodify(wd, ':t')
|
||||
for _, arg in ipairs({'%', 1, 'X', wd}) do
|
||||
@@ -103,7 +104,7 @@ describe('bufnr() function', function()
|
||||
it('returns expected buffer number', function()
|
||||
eq(1, funcs.bufnr('%'))
|
||||
command('file ' .. fname)
|
||||
local wd = lfs.currentdir()
|
||||
local wd = luv.cwd()
|
||||
local curdirname = funcs.fnamemodify(wd, ':t')
|
||||
eq(1, funcs.bufnr(fname))
|
||||
eq(1, funcs.bufnr(wd))
|
||||
@@ -144,7 +145,7 @@ describe('bufwinnr() function', function()
|
||||
eq(-1, funcs.bufwinnr('X'))
|
||||
end)
|
||||
before_each(function()
|
||||
lfs.mkdir(dirname)
|
||||
mkdir(dirname)
|
||||
end)
|
||||
after_each(function()
|
||||
rmdir(dirname)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local lfs = require('lfs')
|
||||
local mkdir = helpers.mkdir
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local exc_exec = helpers.exc_exec
|
||||
@@ -56,11 +56,11 @@ end)
|
||||
describe("backtick expansion", function()
|
||||
setup(function()
|
||||
clear()
|
||||
lfs.mkdir("test-backticks")
|
||||
mkdir("test-backticks")
|
||||
write_file("test-backticks/file1", "test file 1")
|
||||
write_file("test-backticks/file2", "test file 2")
|
||||
write_file("test-backticks/file3", "test file 3")
|
||||
lfs.mkdir("test-backticks/subdir")
|
||||
mkdir("test-backticks/subdir")
|
||||
write_file("test-backticks/subdir/file4", "test file 4")
|
||||
-- Long path might cause "Press ENTER" prompt; use :silent to avoid it.
|
||||
command('silent cd test-backticks')
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
local lfs = require('lfs')
|
||||
local luv = require('luv')
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, command, eval, eq = helpers.clear, helpers.command, helpers.eval, helpers.eq
|
||||
local mkdir = helpers.mkdir
|
||||
|
||||
before_each(function()
|
||||
clear()
|
||||
lfs.mkdir('test-glob')
|
||||
mkdir('test-glob')
|
||||
|
||||
-- Long path might cause "Press ENTER" prompt; use :silent to avoid it.
|
||||
command('silent cd test-glob')
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
lfs.rmdir('test-glob')
|
||||
luv.fs_rmdir('test-glob')
|
||||
end)
|
||||
|
||||
describe('glob()', function()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local lfs = require('lfs')
|
||||
local luv = require('luv')
|
||||
|
||||
local mkdir = helpers.mkdir
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local funcs = helpers.funcs
|
||||
@@ -19,16 +20,16 @@ local ddname_tail = '2'
|
||||
local ddname = dname .. '/' .. ddname_tail
|
||||
|
||||
before_each(function()
|
||||
lfs.mkdir(dname)
|
||||
lfs.mkdir(ddname)
|
||||
mkdir(dname)
|
||||
mkdir(ddname)
|
||||
clear()
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
os.remove(fname)
|
||||
os.remove(dfname)
|
||||
lfs.rmdir(ddname)
|
||||
lfs.rmdir(dname)
|
||||
luv.fs_rmdir(ddname)
|
||||
luv.fs_rmdir(dname)
|
||||
end)
|
||||
|
||||
describe('writefile()', function()
|
||||
|
||||
Reference in New Issue
Block a user