aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/msgpack_functions_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-09-22 10:28:26 +0800
committerzeertzjq <zeertzjq@outlook.com>2025-09-22 14:03:42 +0800
commit777dafdc4602a07cacaae59e57f9262423aa66fd (patch)
tree64ea6a7b2ee91359e869aba5ee31311e6211a0ee /test/functional/vimscript/msgpack_functions_spec.lua
parent4adfc4b7bcd1f4021e9b338273ee43822294ca43 (diff)
downloadrneovim-777dafdc4602a07cacaae59e57f9262423aa66fd.tar.gz
rneovim-777dafdc4602a07cacaae59e57f9262423aa66fd.tar.bz2
rneovim-777dafdc4602a07cacaae59e57f9262423aa66fd.zip
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.
Diffstat (limited to 'test/functional/vimscript/msgpack_functions_spec.lua')
-rw-r--r--test/functional/vimscript/msgpack_functions_spec.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/functional/vimscript/msgpack_functions_spec.lua b/test/functional/vimscript/msgpack_functions_spec.lua
index d2011f9fec..6e85bd466f 100644
--- a/test/functional/vimscript/msgpack_functions_spec.lua
+++ b/test/functional/vimscript/msgpack_functions_spec.lua
@@ -10,7 +10,7 @@ local exc_exec = n.exc_exec
local is_os = t.is_os
describe('msgpack*() functions', function()
- before_each(clear)
+ setup(clear)
local obj_test = function(msg, obj)
it(msg, function()
@@ -415,7 +415,7 @@ local parse_eq = function(expect, list_arg)
end
describe('msgpackparse() function', function()
- before_each(clear)
+ setup(clear)
it('restores nil as v:null', function()
parse_eq(eval('[v:null]'), { '\192' })
@@ -525,7 +525,7 @@ describe('msgpackparse() function', function()
end)
it('fails to parse a partial', function()
- command('function T() dict\nendfunction')
+ command('function! T() dict\nendfunction')
eq(
'Vim(call):E899: Argument of msgpackparse() must be a List or Blob',
exc_exec('call msgpackparse(function("T", [1, 2], {}))')
@@ -555,7 +555,7 @@ describe('msgpackparse() function', function()
end)
describe('msgpackdump() function', function()
- before_each(clear)
+ setup(clear)
local dump_eq = function(exp_list, arg_expr)
eq(exp_list, eval('msgpackdump(' .. arg_expr .. ')'))
@@ -636,7 +636,7 @@ describe('msgpackdump() function', function()
end)
it('fails to dump a partial', function()
- command('function T() dict\nendfunction')
+ command('function! T() dict\nendfunction')
command('let Todump = function("T", [1, 2], {})')
eq(
'Vim(call):E5004: Error while dumping msgpackdump() argument, index 0, itself: attempt to dump function reference',
@@ -776,7 +776,7 @@ describe('msgpackdump() function', function()
end)
it('fails to dump a partial', function()
- command('function T() dict\nendfunction')
+ command('function! T() dict\nendfunction')
eq(
'Vim(call):E686: Argument of msgpackdump() must be a List',
exc_exec('call msgpackdump(function("T", [1, 2], {}))')