mirror of
https://github.com/neovim/neovim.git
synced 2026-04-26 17:24:18 +00:00
refactor(api): VALIDATE macros #22187
Problem: - API validation involves too much boilerplate. - API validation errors are not consistently worded. Solution: Introduce some macros. Currently these are clumsy, but they at least help with consistency and avoid some nesting.
This commit is contained in:
@@ -751,8 +751,8 @@ describe('Buffer highlighting', function()
|
||||
|
||||
it('validates contents', function()
|
||||
-- this used to leak memory
|
||||
eq('Chunk is not an array', pcall_err(set_virtual_text, id1, 0, {"texty"}, {}))
|
||||
eq('Chunk is not an array', pcall_err(set_virtual_text, id1, 0, {{"very"}, "texty"}, {}))
|
||||
eq('Invalid chunk: expected Array, got String', pcall_err(set_virtual_text, id1, 0, {"texty"}, {}))
|
||||
eq('Invalid chunk: expected Array, got String', pcall_err(set_virtual_text, id1, 0, {{"very"}, "texty"}, {}))
|
||||
end)
|
||||
|
||||
it('can be retrieved', function()
|
||||
|
||||
Reference in New Issue
Block a user