test: don't call clear() in both before_each() and after_each() (#35901)

This commit is contained in:
zeertzjq
2025-09-24 11:41:43 +08:00
committed by GitHub
parent d954763b85
commit a62fb57e58
8 changed files with 0 additions and 14 deletions

View File

@@ -5,7 +5,6 @@ local eq = t.eq
describe('glob', function()
before_each(n.clear)
after_each(n.clear)
local match = function(pattern, str)
return n.exec_lua(function()

View File

@@ -9,7 +9,6 @@ local insert = n.insert
describe('vim.pos', function()
before_each(clear)
after_each(clear)
it('creates a position with or without optional fields', function()
local pos = exec_lua(function()

View File

@@ -9,7 +9,6 @@ local insert = n.insert
describe('vim.range', function()
before_each(clear)
after_each(clear)
it('creates a range with or without optional fields', function()
local range = exec_lua(function()

View File

@@ -33,7 +33,6 @@ describe('vim.snippet', function()
set_snippet_jump(-1, '<S-Tab>')
end)
end)
after_each(clear)
--- @param snippet string[]
--- @param expected string[]

View File

@@ -9,7 +9,6 @@ describe('vim.lsp.codelens', function()
n.clear()
exec_lua('require("vim.lsp")')
end)
after_each(n.clear)
it('on_codelens_stores_and_displays_lenses', function()
local fake_uri = 'file:///fake/uri'

View File

@@ -863,8 +863,6 @@ describe('vim.lsp.completion: protocol', function()
end)
end)
after_each(clear)
local function assert_matches(fn)
retry(nil, nil, function()
fn(exec_lua('return _G.capture.matches'))
@@ -1262,8 +1260,6 @@ describe('vim.lsp.completion: integration', function()
end)
end)
after_each(clear)
it('puts cursor at the end of completed word', function()
local completion_list = {
isIncomplete = false,

View File

@@ -115,10 +115,6 @@ describe('vim.lsp.diagnostic', function()
end)
end)
after_each(function()
clear()
end)
describe('vim.lsp.diagnostic.on_publish_diagnostics', function()
it('correctly handles UTF-16 offsets', function()
local line = 'All 💼 and no 🎉 makes Jack a dull 👦'

View File

@@ -9,7 +9,6 @@ local exec_lua = n.exec_lua
describe('vim.lsp._snippet_grammar', function()
before_each(n.clear)
after_each(n.clear)
local parse = function(...)
local res = exec_lua('return require("vim.lsp._snippet_grammar").parse(...)', ...)