@@ -9,8 +9,10 @@ local headless = require("plenary.nvim_meta").is_headless
99
1010local plenary_dir = vim .fn .fnamemodify (debug.getinfo (1 ).source :match " @?(.*[/\\ ])" , " :p:h:h:h" )
1111
12+ --- @class PlenaryTestHarness
1213local harness = {}
1314
15+ --- @type fun ( _ , ... )
1416local print_output = vim .schedule_wrap (function (_ , ...)
1517 for _ , v in ipairs { ... } do
1618 io.stdout :write (tostring (v ))
@@ -20,7 +22,11 @@ local print_output = vim.schedule_wrap(function(_, ...)
2022 vim .cmd [[ mode]]
2123end )
2224
25+ --- @param job_id integer
26+ --- @return fun ( bufnr : integer , ... : string )
2327local get_nvim_output = function (job_id )
28+ --- @param bufnr integer
29+ --- @param ... string
2430 return vim .schedule_wrap (function (bufnr , ...)
2531 if not vim .api .nvim_buf_is_valid (bufnr ) then
2632 return
@@ -31,6 +37,8 @@ local get_nvim_output = function(job_id)
3137 end )
3238end
3339
40+ --- @param command string
41+ --- @return nil
3442function harness .test_directory_command (command )
3543 local split_string = vim .split (command , " " )
3644 local directory = vim .fn .expand (table.remove (split_string , 1 ))
@@ -40,6 +48,19 @@ function harness.test_directory_command(command)
4048 return harness .test_directory (directory , opts )
4149end
4250
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
4364local function test_paths (paths , opts )
4465 local minimal = not opts or not opts .init or opts .minimal or opts .minimal_init
4566
@@ -53,6 +74,7 @@ local function test_paths(paths, opts)
5374
5475 vim .env .PLENARY_TEST_TIMEOUT = opts .timeout
5576
77+ --- @type { bufnr : integer , win_id : integer , border_bufnr : integer , border_win_id : integer , job_id : integer }
5678 local res = {}
5779 if not headless then
5880 res = win_float .percentage_range_window (0.95 , 0.70 , opts .winopts )
0 commit comments