mirror of
https://github.com/neovim/neovim.git
synced 2026-04-19 22:10:45 +00:00
fix(lua): pesc, tbl_islist result types #20751
Problem: - pesc() returns multiple results, it should return a single result. - tbl_islist() returns non-boolean in some branches. - Docstring: @generic must be declared first Solution: Constrain docstring annotations. Fix return types. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
@@ -430,6 +430,8 @@ describe('lua stdlib', function()
|
||||
it('vim.pesc', function()
|
||||
eq('foo%-bar', exec_lua([[return vim.pesc('foo-bar')]]))
|
||||
eq('foo%%%-bar', exec_lua([[return vim.pesc(vim.pesc('foo-bar'))]]))
|
||||
-- pesc() returns one result. #20751
|
||||
eq({'x'}, exec_lua([[return {vim.pesc('x')}]]))
|
||||
|
||||
-- Validates args.
|
||||
matches('s: expected string, got number',
|
||||
|
||||
Reference in New Issue
Block a user