test: fix some type warnings (#37483)

This commit is contained in:
zeertzjq
2026-01-21 15:11:47 +08:00
committed by GitHub
parent c556972ae1
commit 1883fe39bd
8 changed files with 19 additions and 15 deletions

View File

@@ -543,7 +543,7 @@ end
describe('TUI', function()
local screen --[[@type test.functional.ui.screen]]
local child_session --[[@type test.Session]]
local child_exec_lua
local child_exec_lua --[[@type fun(code: string, ...):any]]
before_each(function()
clear()
@@ -2987,8 +2987,8 @@ describe('TUI UIEnter/UILeave', function()
end)
describe('TUI FocusGained/FocusLost', function()
local screen
local child_session
local screen --[[@type test.functional.ui.screen]]
local child_session --[[@type test.Session]]
before_each(function()
clear()
@@ -3181,7 +3181,7 @@ end)
-- These tests require `tt` because --headless/--embed does not initialize the TUI.
describe("TUI 't_Co' (terminal colors)", function()
local screen
local screen --[[@type test.functional.ui.screen]]
local function assert_term_colors(term, colorterm, maxcolors)
clear({ env = { TERM = term }, args = {} })
@@ -3199,7 +3199,7 @@ describe("TUI 't_Co' (terminal colors)", function()
},
})
local tline
local tline --[[@type string]]
if maxcolors == 8 then
tline = '{112:~ }'
elseif maxcolors == 16 then
@@ -3460,7 +3460,7 @@ end)
-- These tests require `tt` because --headless/--embed does not initialize the TUI.
describe("TUI 'term' option", function()
local screen
local screen --[[@type test.functional.ui.screen]]
local function assert_term(term_envvar, term_expected)
clear()
@@ -3511,7 +3511,7 @@ end)
-- These tests require `tt` because --headless/--embed does not initialize the TUI.
describe('TUI', function()
local screen
local screen --[[@type test.functional.ui.screen]]
-- Runs (child) `nvim` in a TTY (:terminal), to start the builtin TUI.
local function nvim_tui(extra_args)

View File

@@ -33,6 +33,8 @@ function M.feed_csi(data)
M.feed_termcode('[' .. data)
end
--- @param session test.Session
--- @return fun(code: string, ...):any
function M.make_lua_executor(session)
return function(code, ...)
local status, rv = session:request('nvim_exec_lua', code, { ... })

View File

@@ -447,6 +447,7 @@ end
--- @field mouse_enabled? boolean
---
--- @field win_viewport? table<integer,table<string,integer>>
--- @field win_viewport_margins? table<integer,table<string,integer>>
--- @field win_pos? table<integer,table<string,integer>>
--- @field float_pos? [integer,integer]
--- @field hl_groups? table<string,integer>