mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
test: reduce some clear() calls
Use only a single clear() call in some test/functional/vimscript/ test files whose test cases have very little side effect. A downside of using a single clear() is that if a crash happens in one test case, all following test cases in the same file will also fail, but these functionalities and tests don't change very often.
This commit is contained in:
@@ -13,8 +13,8 @@ local NIL = vim.NIL
|
||||
local source = n.source
|
||||
|
||||
describe('json_decode() function', function()
|
||||
local restart = function(...)
|
||||
clear(...)
|
||||
setup(function()
|
||||
clear()
|
||||
source([[
|
||||
language C
|
||||
function Eq(exp, act)
|
||||
@@ -57,8 +57,7 @@ describe('json_decode() function', function()
|
||||
endif
|
||||
endfunction
|
||||
]])
|
||||
end
|
||||
before_each(restart)
|
||||
end)
|
||||
|
||||
local speq = function(expected, actual_expr)
|
||||
eq(1, fn.EvalEq(expected, actual_expr))
|
||||
@@ -627,7 +626,7 @@ describe('json_decode() function', function()
|
||||
end)
|
||||
|
||||
describe('json_encode() function', function()
|
||||
before_each(function()
|
||||
setup(function()
|
||||
clear()
|
||||
command('language C')
|
||||
end)
|
||||
|
Reference in New Issue
Block a user