@@ -9,8 +9,10 @@ local headless = require("plenary.nvim_meta").is_headless
9
9
10
10
local plenary_dir = vim .fn .fnamemodify (debug.getinfo (1 ).source :match " @?(.*[/\\ ])" , " :p:h:h:h" )
11
11
12
+ --- @class PlenaryTestHarness
12
13
local harness = {}
13
14
15
+ --- @type fun ( _ , ... )
14
16
local print_output = vim .schedule_wrap (function (_ , ...)
15
17
for _ , v in ipairs { ... } do
16
18
io.stdout :write (tostring (v ))
@@ -20,7 +22,11 @@ local print_output = vim.schedule_wrap(function(_, ...)
20
22
vim .cmd [[ mode]]
21
23
end )
22
24
25
+ --- @param job_id integer
26
+ --- @return fun ( bufnr : integer , ... : string )
23
27
local get_nvim_output = function (job_id )
28
+ --- @param bufnr integer
29
+ --- @param ... string
24
30
return vim .schedule_wrap (function (bufnr , ...)
25
31
if not vim .api .nvim_buf_is_valid (bufnr ) then
26
32
return
@@ -31,6 +37,8 @@ local get_nvim_output = function(job_id)
31
37
end )
32
38
end
33
39
40
+ --- @param command string
41
+ --- @return nil
34
42
function harness .test_directory_command (command )
35
43
local split_string = vim .split (command , " " )
36
44
local directory = vim .fn .expand (table.remove (split_string , 1 ))
@@ -40,6 +48,19 @@ function harness.test_directory_command(command)
40
48
return harness .test_directory (directory , opts )
41
49
end
42
50
51
+ --- @class PlenaryTestHarnessOptions
52
+ --- @field init ? string
53
+ --- @field keep_going ? boolean
54
+ --- @field minimal ? boolean
55
+ --- @field minimal_init ? string
56
+ --- @field nvim_cmd ? string
57
+ --- @field sequential ? boolean
58
+ --- @field timeout ? integer
59
+ --- @field winopts ? PlenaryWindowFloatOptions
60
+
61
+ --- @param paths string[]
62
+ --- @param opts ? PlenaryTestHarnessOptions
63
+ --- @return nil
43
64
local function test_paths (paths , opts )
44
65
local minimal = not opts or not opts .init or opts .minimal or opts .minimal_init
45
66
@@ -53,6 +74,7 @@ local function test_paths(paths, opts)
53
74
54
75
vim .env .PLENARY_TEST_TIMEOUT = opts .timeout
55
76
77
+ --- @type { bufnr : integer , win_id : integer , border_bufnr : integer , border_win_id : integer , job_id : integer }
56
78
local res = {}
57
79
if not headless then
58
80
res = win_float .percentage_range_window (0.95 , 0.70 , opts .winopts )
0 commit comments