mirror of
https://github.com/neovim/neovim.git
synced 2026-02-08 12:57:22 +00:00
test: fix some type warnings (#37483)
This commit is contained in:
@@ -149,9 +149,9 @@ ProcStream.__index = ProcStream
|
||||
--- @param argv string[]
|
||||
--- @param env string[]?
|
||||
--- @param io_extra uv.uv_pipe_t?
|
||||
--- @param on_exit fun(closed: integer?)? Called after the child process exits.
|
||||
--- @param forward_stderr forward stderr from the nvim process. otherwise collect it.
|
||||
--- @param on_exit fun(closed: integer?)? Called after the child process exits.
|
||||
--- `closed` is the timestamp (uv.now()) when close() was called, or nil if it wasn't.
|
||||
--- @param forward_stderr boolean? Forward child process stderr, otherwise collect it.
|
||||
--- @return test.ProcStream
|
||||
function ProcStream.spawn(argv, env, io_extra, on_exit, forward_stderr)
|
||||
local self = setmetatable({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
local M = {}
|
||||
|
||||
M.include_paths = {}
|
||||
M.include_paths = {} --- @type string[]
|
||||
for p in ("${TEST_INCLUDE_DIRS}" .. ";"):gmatch("[^;]+") do
|
||||
table.insert(M.include_paths, p)
|
||||
end
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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, { ... })
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -49,7 +49,7 @@ function M.fix_slashes(obj)
|
||||
end
|
||||
|
||||
--- @param ... string|string[]
|
||||
--- @return string
|
||||
--- @return string[]
|
||||
function M.argss_to_cmd(...)
|
||||
local cmd = {} --- @type string[]
|
||||
for i = 1, select('#', ...) do
|
||||
|
||||
@@ -163,8 +163,7 @@ end
|
||||
--- @param hdr string
|
||||
--- @return string[]?
|
||||
function Gcc:dependencies(hdr)
|
||||
--- @type string
|
||||
local cmd = argss_to_cmd(self.path, { '-M', hdr }) .. ' 2>&1'
|
||||
local cmd = table.concat(argss_to_cmd(self.path, { '-M', hdr }), ' ') .. ' 2>&1'
|
||||
local out = assert(io.popen(cmd))
|
||||
local deps = out:read('*a')
|
||||
out:close()
|
||||
|
||||
@@ -201,8 +201,10 @@ local function is_child_cdefs()
|
||||
return os.getenv('NVIM_TEST_MAIN_CDEFS') ~= '1'
|
||||
end
|
||||
|
||||
-- use this helper to import C files, you can pass multiple paths at once,
|
||||
-- this helper will return the C namespace of the nvim library.
|
||||
--- use this helper to import C files, you can pass multiple paths at once,
|
||||
--- this helper will return the C namespace of the nvim library.
|
||||
---
|
||||
--- @param ... string
|
||||
local function cimport(...)
|
||||
local previous_defines --- @type string
|
||||
local preprocess_cache --- @type table<string,string>
|
||||
|
||||
Reference in New Issue
Block a user