261020.8 · 1d9084be82cefff23a06b2d091d4d484f78cdb3f
test: make the suite pass consistently on Windows/slow machines
- screenshot captures now retry (Linux: 4x250ms, else 20x500ms) with
a fresh capture per attempt (nested process spawns like the
`line_query` transform can take >10s before the preview renders)
- wait until the screen stops changing before capturing
- invalidate the whole screen before capturing on Windows: moving
floats (fzf term float, preview scrollbar thumb) leave previously
composited cells behind which plain `:redraw` skips as valid
- `child.stop` uses rpcnotify + jobwait/jobstop instead of rpcrequest
`0cquit`, which could hang indefinitely on Windows
- headless test children default to `pipe_cmd` on Windows
- skip the `find` executable case on Windows: `dir /s/b` output cannot
reproduce the Linux `find` reference (absolute paths, attribute and
symlink count differences)
- ui_select #2743 test: hermetic `$TMUX` (inherit + real fzf popup
fails in the headless child) and `vim.NIL` result comparison
reading declarations
Changes to tests/ui_select_spec.lua. All files
@@ -70,7 +70,7 @@ local function open_picker(items, preview_lines, ui_opts) end, { items, preview_lines, ui_opts or {} }) child.wait_until(function() return child.lua_get([[_G._fzf_lua_on_create]]) == true- or child.lua_get([[_G._ui_select_errors]]) ~= nil+ or child.lua_get([[_G._ui_select_errors]]) ~= vim.NIL end, 5000) local errs = child.lua_get([[_G._ui_select_errors]]) eq(errs, vim.NIL, { fail_reason = "vim.ui.select errored: " .. tostring(errs) })@@ -119,6 +119,11 @@ T["ui_select"]["native via fzf-tmux profile #2743"] = function() -- explicit opt (in real tmux the picker runs in a tmux popup; here -- without tmux it degrades to a regular fzf run with the same opts). cleanup_stale_tmpfiles()+ -- hermetic environment: when the suite runs inside tmux (developer+ -- machines) `$TMUX` is inherited by the child and the profile's+ -- `--tmux` flag is kept, fzf spawns a real popup which cannot open+ -- in the headless test child (fzf exits immediately, no error)+ exec_lua([[vim.env.TMUX = nil]]) reload({ "fzf-tmux" }) register() open_picker({ "alpha", "beta" }, { "tmux-line" })