mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
test: remove a few more redundant clear() calls (#35903)
This commit is contained in:
@@ -53,7 +53,7 @@ local tests_windows_paths = {
|
||||
'c:\\users\\foo\\bar\\..\\',
|
||||
}
|
||||
|
||||
before_each(clear)
|
||||
setup(clear)
|
||||
|
||||
describe('vim.fs', function()
|
||||
describe('parents()', function()
|
||||
@@ -354,6 +354,10 @@ describe('vim.fs', function()
|
||||
command('edit test/functional/fixtures/tty-test.c')
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
command('bwipe!')
|
||||
end)
|
||||
|
||||
it('works with a single marker', function()
|
||||
eq(test_source_path, exec_lua([[return vim.fs.root(0, 'CMakePresets.json')]]))
|
||||
end)
|
||||
@@ -466,8 +470,9 @@ describe('vim.fs', function()
|
||||
eq(
|
||||
xdg_config_home .. '/nvim',
|
||||
exec_lua(function()
|
||||
vim.env.XDG_CONFIG_HOME = xdg_config_home
|
||||
return vim.fs.normalize('$XDG_CONFIG_HOME/nvim')
|
||||
return vim._with({ env = { XDG_CONFIG_HOME = xdg_config_home } }, function()
|
||||
return vim.fs.normalize('$XDG_CONFIG_HOME/nvim')
|
||||
end)
|
||||
end)
|
||||
)
|
||||
end)
|
||||
|
@@ -1,15 +1,10 @@
|
||||
local t = require('test.testutil')
|
||||
local n = require('test.functional.testnvim')()
|
||||
|
||||
local eq = t.eq
|
||||
|
||||
describe('glob', function()
|
||||
before_each(n.clear)
|
||||
|
||||
local match = function(pattern, str)
|
||||
return n.exec_lua(function()
|
||||
return require('vim.glob').to_lpeg(pattern):match(str) ~= nil
|
||||
end)
|
||||
return require('vim.glob').to_lpeg(pattern):match(str) ~= nil
|
||||
end
|
||||
|
||||
describe('glob matching', function()
|
||||
|
@@ -1,12 +1,8 @@
|
||||
local t = require('test.testutil')
|
||||
local n = require('test.functional.testnvim')()
|
||||
|
||||
local clear = n.clear
|
||||
local eq = t.eq
|
||||
|
||||
describe('vim.text', function()
|
||||
before_each(clear)
|
||||
|
||||
describe('indent()', function()
|
||||
it('validation', function()
|
||||
t.matches('size%: expected number, got string', t.pcall_err(vim.text.indent, 'x', 'x'))
|
||||
|
Reference in New Issue
Block a user