From 4573cfa3adac3a7dbf1b6b032471a1c14adc7427 Mon Sep 17 00:00:00 2001 From: NAKAI Tsuyoshi <82267684+uga-rosa@users.noreply.github.com> Date: Mon, 24 Oct 2022 21:53:53 +0900 Subject: 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 --- test/functional/lua/vim_spec.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/functional/lua/vim_spec.lua') diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index ecfb7275cd..38f772c5cf 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -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', -- cgit