250903.4 · 997d07bffcb51914d5dd797aca604cf3b410cd84
test: serialize
reading declarations
@@ -107,7 +107,7 @@ end function M.run(child, lvl, code, arg) local rv = child.lua( [[return { require('fzf-lua.test.exec_lua').handler(...) }]],- { string.dump(code), get_upvalues(code), unpack(arg) })+ { string.dump(code), get_upvalues(code), unpack(arg or {}) }) --- @type any[], table<string,any>, string[] local ret, upvalues, messages = unpack(rv)@@ -138,4 +138,58 @@ function M.run(child, lvl, code, arg) return unpack(ret, 2, table.maxn(ret)) end +local function save_upvalues(v, t)+ if type(v) == "userdata" or type(v) == "thread" then+ error("unsupported upvalue type: " .. type(v))+ elseif type(v) == "function" then+ -- hopefully serpent serialize/deserialize?? don't change the string.dump id+ local bytecode = string.dump(v)+ -- TODO: same body but with different upv, still have the same id...+ -- TODO: support function upv?+ t[bytecode] = t[bytecode] or get_upvalues(v)+ return+ elseif type(v) == "table" then+ for _, e in pairs(v) do save_upvalues(e, t) end+ end+end++-- TODO: upvalues+local function load_upvalues(v, t)+ if type(v) == "function" then+ local bytecode = string.dump(v)+ local upvalues = t[bytecode]+ t[bytecode] = nil+ return function(...)+ return unpack((M.handler(bytecode, upvalues, ...)))+ end+ end+ if type(v) == "table" then+ for k, e in ipairs(v) do+ v[k] = load_upvalues(e, t)+ end+ end+ return v+end++---@param s string+---@return table+M.deserialize = function(s)+ local _, args = require("fzf-lua.lib.serpent").load(s, { safe = false })+ assert(type(args) == "table", "args should be table")+ -- for i, v in ipairs(args) do+ -- args[i] = load_upvalues(v, args)+ -- end+ return args+end++---@param ...any+---@return string+M.serialize = function(...)+ local args = { ... }+ -- for _, v in ipairs(args) do+ -- save_upvalues(v, args)+ -- end+ return require("fzf-lua.lib.serpent").block(args, { comment = false, sortkeys = false })+end+ return M
@@ -132,17 +132,32 @@ M.new_child_neovim = function() return require("fzf-lua.test.exec_lua").run(child, 2, code, arg) end + -- TODO: support "function" upvalue+ child.FzfLua = setmetatable({}, {+ __index = function(_, k)+ return function(...)+ child.lua(function(s)+ local args = require("fzf-lua.test.exec_lua").deserialize(s) or {}+ FzfLua[k](unpack(args))+ end, { require("fzf-lua.test.exec_lua").serialize(...) })+ end+ end+ })+ --- Setup fzf-lua ---@param config? table, config table child.setup = function(config)- local lua_cmd = ([[+ -- using "FZF_DEFAULT_OPTS" hangs the command on the+ -- child process and the loading indicator never stops+ local defaults = M.IS_WIN() and { pipe_cmd = true } or nil+ child.lua(function(...) require("fzf-lua").setup(vim.tbl_deep_extend("keep", ..., { { "default-title" },- %s+ defaults = defaults, winopts = { on_create = function(e) _G._fzf_lua_on_create = true- vim.wo[e.winid].statusline='fzf://'+ vim.wo[e.winid].statusline = "fzf://" end, on_close = function() _G._fzf_lua_on_create = nil@@ -154,27 +169,23 @@ M.new_child_neovim = function() -- keymap = { fzf = { true, load = function() _G._fzf_load_called = true end } } fzf_cli_args = "--bind=" .. FzfLua.libuv.shellescape("load:+execute-silent:" .. FzfLua.shell.stringify_data(function(_, _, _)- _G._fzf_load_called = true- end, {}))+ _G._fzf_load_called = true+ end, {})) }))- ]])- -- using "FZF_DEFAULT_OPTS" hangs the command on the- -- child process and the loading indicator never stops- :format(M.IS_WIN() and "defaults = { pipe_cmd = true }," or "")- child.lua(lua_cmd, { config or {} })+ end, { config or {} }) end --- Unload fzf-lua and side effects child.unload = function() -- Unload Lua module child.lua([[_G.FzfLua = nil]])- child.lua([[- for k, v in pairs(package.loaded) do+ child.lua(function()+ for k, _ in pairs(package.loaded) do if k:match("^fzf%-lua") then package.loaded[k] = nil end end- ]])+ end) -- Remove global vars for _, var in ipairs({ "server", "directory", "root" }) do@@ -411,19 +422,17 @@ end M.FzfLua = setmetatable({}, { __index = function(_, api) return function(child, ...)- local serpent = require "fzf-lua.lib.serpent" local eq = M.expect.equality- local args = { ... }- -- When using `fzf_exec` opts are at index[2], or otherwise at index[1] -- remove index[1] into "contents" so index[1] is always our "opts"- local contents = (api == "fzf_exec" or api == "fzf_live")- and (table.remove(args, 1) .. ",") or ""+ local opts, ci_opts, contents+ contents = (api == "fzf_exec" or api == "fzf_live") and (select(1, ...)) or nil+ opts = (api == "fzf_exec" or api == "fzf_live") and (select(2, ...)) or (select(1, ...)) or {} -- Split "opts" and "ci_opts" which are double underscore prefixed- local opts, ci_opts = (function()+ opts, ci_opts = (function() local o, ci_o = {}, {}- for k, v in pairs(args[1] or {}) do+ for k, v in pairs(opts) do if k:match("^__") then ci_o[k] = v else@@ -433,9 +442,6 @@ M.FzfLua = setmetatable({}, { return o, ci_o end)() - -- Override args[1] with stripped opts (excluding ci_opts)- args[1] = opts- -- Added addittional wait for `fn_postprocess` due to #1914, proved to be flakey -- on MacOs but I actually like it that we're testing `fn_postprocess` as well as -- RPC connection from child to main instance using with `_G._fzf_lua_server`@@ -449,18 +455,14 @@ M.FzfLua = setmetatable({}, { or [[return function(_) _G._fzf_postprocess_called = true end]] end - -- Stringify supplied opts- local serlialized = serpent.block(args, { comment = false, sortkeys = false })-- -- HACK: test previewer needs to be unquoted- serlialized = serlialized:gsub([[(")(require%(.-%))(")]], "%2")- -- print("c", contents, "o", serlialized)- -- Verify postprocess var is nil before opening fzf-lua eq(child.lua_get([[_G._fzf_postprocess_called]]), vim.NIL) - -- Open fzf-lua with args, can open both fzf_exec and files, grep, etc- child.lua(string.format("FzfLua.%s(%sunpack(%s))", api, contents, serlialized))+ if contents then+ child.FzfLua[api](contents, opts)+ else+ child.FzfLua[api](opts)+ end -- Verify `winopts.on_create` was called eq(child.lua_get([[_G._fzf_lua_on_create]]), true)
@@ -44,8 +44,13 @@ T["actions"]["reload"] = new_set({ function(api) local screen_opts = { ignore_text = { 28 } } helpers.FzfLua[api](child, api == "fzf_exec"- and [[function(cb) cb(_G._fzf_reload and 'reloaded' or 'unreloaded') cb(nil) end]]- or [[function() return { _G._fzf_reload and 'reloaded' or 'unreloaded' } end ]],+ and function(cb)+ cb(_G._fzf_reload and "reloaded" or "unreloaded")+ cb(nil)+ end+ or function()+ return { _G._fzf_reload and "reloaded" or "unreloaded" }+ end, { __no_abort = true, __expect_lines = false,
@@ -12,38 +12,37 @@ T["api"] = new_set({ n_retry = not helpers.IS_LINUX() and 5 or nil }) T["api"]["fzf_exec"] = new_set() T["api"]["fzf_exec"]["table"] = function()- helpers.FzfLua.fzf_exec(child, [==[(function()- local contents = {}- for i = 1, 100 do- for j, s in ipairs({ "foo", "bar", "baz" }) do- table.insert(contents, tostring((i - 1) * 3 + j) .. ": " .. s)- end- end- return contents- end)()]==],+ local contents = {}+ for i = 1, 100 do+ for j, s in ipairs({ "foo", "bar", "baz" }) do+ table.insert(contents, tostring((i - 1) * 3 + j) .. ": " .. s)+ end+ end+ helpers.FzfLua.fzf_exec(child, contents, { __expect_lines = true, __postprocess_wait = true }) end T["api"]["fzf_exec"]["function"] = new_set({ parametrize = { { "sync" }, { "async" } } }, { function(type) if type == "sync" then- helpers.FzfLua.fzf_exec(child, [==[(function(fzf_cb)- for i=1, 1000 do+ helpers.FzfLua.fzf_exec(child, function(fzf_cb)+ for i = 1, 1000 do fzf_cb(tostring(i)) end fzf_cb(nil)- end)- ]==],+ end, { __expect_lines = true, __postprocess_wait = true }) else- helpers.FzfLua.fzf_exec(child, [==[(coroutine.wrap(function(fzf_cb)- local co = coroutine.running()- for i=1, 1000 do- fzf_cb(tostring(i), function() coroutine.resume(co) end)- coroutine.yield()- end- fzf_cb(nil)- end))]==],+ helpers.FzfLua.fzf_exec(child, function(fzf_cb)+ coroutine.wrap(function()+ local co = coroutine.running()+ for i = 1, 1000 do+ fzf_cb(tostring(i), function() coroutine.resume(co) end)+ coroutine.yield()+ end+ fzf_cb(nil)+ end)()+ end, { __expect_lines = true, __postprocess_wait = true }) end end,@@ -52,7 +51,7 @@ T["api"]["fzf_exec"]["function"] = new_set({ parametrize = { { "sync" }, { "asyn T["api"]["fzf_exec"]["rg"] = new_set({ parametrize = { { true }, { false }, { 1 } } }, { function(multiprocess) helpers.FzfLua.fzf_exec(child,- [['rg --files -g !.git -g !tests/** --sort=path']],+ "rg --files -g !.git -g !tests/** --sort=path", { __expect_lines = true, -- __postprocess_wait = multiprocess ~= 1,@@ -69,7 +68,7 @@ T["api"]["fzf_exec"]["fn_transform"]["filter"] = new_set( function(multiprocess, filter) local AND = helpers.IS_WIN() and "&" or "&&" helpers.FzfLua.fzf_exec(child,- string.format([["echo one%secho two%secho three%secho four"]], AND, AND, AND),+ string.format("echo one%secho two%secho three%secho four", AND, AND, AND), { -- __postprocess_wait = multiprocess ~= 1, __expect_lines = true,@@ -93,7 +92,7 @@ T["api"]["fzf_exec"]["fn_transform"]["filter"] = new_set( T["api"]["fzf_live"] = new_set() T["api"]["fzf_live"]["table"] = function()- helpers.FzfLua.fzf_live(child, [==[function(args)+ helpers.FzfLua.fzf_live(child, function(args) local q = args[1] if not tonumber(q) then return { "Invalid number: " .. tostring(q) }@@ -105,7 +104,7 @@ T["api"]["fzf_live"]["table"] = function() end end return lines- end]==],+ end, { __expect_lines = true, __postprocess_wait = true,@@ -116,7 +115,7 @@ end T["api"]["fzf_live"]["function"] = new_set({ parametrize = { { "sync" }, { "async" } } }, { function(type) if type == "sync" then- helpers.FzfLua.fzf_live(child, [==[function(args)+ helpers.FzfLua.fzf_live(child, function(args) local q = args[1] return function(fzf_cb) if not tonumber(q) then@@ -130,14 +129,14 @@ T["api"]["fzf_live"]["function"] = new_set({ parametrize = { { "sync" }, { "asyn end fzf_cb(nil) end- end]==],+ end, { __expect_lines = true, __postprocess_wait = true, query = 100, }) else- helpers.FzfLua.fzf_live(child, [==[function(args)+ helpers.FzfLua.fzf_live(child, function(args) local q = args[1] return coroutine.wrap(function(fzf_cb) local co = coroutine.running()@@ -154,7 +153,7 @@ T["api"]["fzf_live"]["function"] = new_set({ parametrize = { { "sync" }, { "asyn end fzf_cb(nil) end)- end]==],+ end, { __expect_lines = true, __postprocess_wait = true,@@ -168,7 +167,7 @@ T["api"]["fzf_live"]["rg"] = new_set() T["api"]["fzf_live"]["rg"]["error"] = new_set({ parametrize = { { true }, { false }, { 1 } } }, { function(multiprocess)- helpers.FzfLua.fzf_live(child, [["rg --column --line-number --smart-case"]], {+ helpers.FzfLua.fzf_live(child, "rg --column --line-number --smart-case", { __expect_lines = true, -- multiprocess==1 should fallback to native (no [DEBUG] line) -- as no fn_transform or fn_preprocess are present@@ -186,7 +185,7 @@ T["api"]["fzf_live"]["rg"]["no error"] = new_set( function(query) helpers.FzfLua.fzf_live(child, string.format(- [["rg --column --line-number --smart-case --sort=path -g !tests/ -- <query> 2> %s"]],+ "rg --column --line-number --smart-case --sort=path -g !tests/ -- <query> 2> %s", helpers.IS_WIN() and "nul" or "/dev/null" ), {@@ -210,8 +209,8 @@ T["api"]["events"] = new_set( local prompt = "EventsPrompt>" helpers.FzfLua[api](child, api == "fzf_exec"- and [[(function() return { "foo", "bar", "baz" } end)()]]- or [[function() return { "foo", "bar", "baz" } end ]],+ and (function() return { "foo", "bar", "baz" } end)()+ or function() return { "foo", "bar", "baz" } end, { __expect_lines = true, prompt = prompt,
@@ -82,7 +82,7 @@ T["files"]["previewer"]["builtin"] = new_set({ parametrize = { { "ci" }, { "buil winopts = { preview = { scrollbar = false } }, previewer = previewer == "builtin" and "builtin"- or [[require('fzf-lua.test.previewer')]],+ or function() return require("fzf-lua.test.previewer") end, __after_open = function() -- Verify previewer "last_entry" was set child.type_keys("<c-j>")
tests/screenshots/tests-actions_spec.lua---actions---ui-don't-freeze-on-error
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,3 All +28|-- TERMINAL -- 1,39 All
tests/screenshots/tests-actions_spec.lua---actions---ui-don't-freeze-on-error-002
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,40 All
tests/screenshots/tests-api_spec.lua---api---events---1-+-args-{-'fzf_exec'-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,14 All
tests/screenshots/tests-api_spec.lua---api---events---1-+-args-{-'fzf_live'-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,14 All
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-api_spec.lua---api---fzf_exec---fn_transform---filter---1-+-args-{-true,-0-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-api_spec.lua---api---fzf_exec---function---1-+-args-{-'async'-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-api_spec.lua---api---fzf_exec---function---1-+-args-{-'sync'-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-api_spec.lua---api---fzf_exec---rg---1-+-args-{-1-}
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭─────────────────────────────────────────────────╮ -04|~ │> 84/84 │ +04|~ │> 85/85 │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ LICENSE ││ 07|~ │ Makefile ││ @@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-api_spec.lua---api---fzf_exec---rg---1-+-args-{-false-}
@@ -2,11 +2,11 @@ 01| 02|~ 03|~ ╭─────────────────────────────────────────────────╮ -04|~ │> 85/85 │ +04|~ │> 86/86 │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ [DEBUG] [st] rg --files -g !.git -g !tests/*··││ 07|~ │ LICENSE ││ -08|~ │ Makefile ││ +08|~ │ Makefile │ 09|~ │ OPTIONS.md │ 10|~ │ README-Win.md │ 11|~ │ README.md │ @@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-api_spec.lua---api---fzf_exec---rg---1-+-args-{-true-}
@@ -2,11 +2,11 @@ 01| 02|~ 03|~ ╭─────────────────────────────────────────────────╮ -04|~ │> 85/85 │ +04|~ │> 86/86 │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ [DEBUG] [mt] rg --files -g !.git -g !tests/*··││ 07|~ │ LICENSE ││ -08|~ │ Makefile ││ +08|~ │ Makefile │ 09|~ │ OPTIONS.md │ 10|~ │ README-Win.md │ 11|~ │ README.md │ @@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-api_spec.lua---api---fzf_exec---table
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-api_spec.lua---api---fzf_live---function---1-+-args-{-'async'-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,6 All
tests/screenshots/tests-api_spec.lua---api---fzf_live---function---1-+-args-{-'sync'-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,6 All
tests/screenshots/tests-api_spec.lua---api---fzf_live---rg---error---1-+-args-{-1-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,4 All
tests/screenshots/tests-api_spec.lua---api---fzf_live---rg---error---1-+-args-{-false-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,4 All
tests/screenshots/tests-api_spec.lua---api---fzf_live---rg---error---1-+-args-{-true-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,4 All
tests/screenshots/tests-api_spec.lua---api---fzf_live---rg---no-error---1-+-args-{-'['-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,4 All
tests/screenshots/tests-api_spec.lua---api---fzf_live---rg---no-error---1-+-args-{-'table-of-cont'-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,16 All
tests/screenshots/tests-api_spec.lua---api---fzf_live---table
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,6 All
tests/screenshots/tests-files_spec.lua---files---close-abort---1-+-args-{-'-c-c-'-}
@@ -2,11 +2,11 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 85/85 (0) │ +04|~ │> 86/86 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ [DEBUG] [mt] rg --files --sort=path -g !test··││ 07|~ │ LICENSE ││ -08|~ │ Makefile ││ +08|~ │ Makefile │ 09|~ │ OPTIONS.md │ 10|~ │ README-Win.md │ 11|~ │ README.md │ @@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-files_spec.lua---files---close-abort---1-+-args-{-'-esc-'-}
@@ -2,11 +2,11 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 85/85 (0) │ +04|~ │> 86/86 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ [DEBUG] [mt] rg --files --sort=path -g !test··││ 07|~ │ LICENSE ││ -08|~ │ Makefile ││ +08|~ │ Makefile │ 09|~ │ OPTIONS.md │ 10|~ │ README-Win.md │ 11|~ │ README.md │ @@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-files_spec.lua---files---executable---1-+-args-{-'fd'-}
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭─────────────────── Files h ────────────────────╮ -04|~ │> 97/97 (0) │ +04|~ │> 98/98 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ [DEBUG] [mt] fd --hidden --color=never --typ··││ 07|~ │ .editorconfig ││ @@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-files_spec.lua---files---executable---1-+-args-{-'find-dir'-}
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 97/97 (0) │ +04|~ │> 98/98 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ [DEBUG] [mt] find . -type f \! -path '*/.git··││ 07|~ │ .editorconfig ││ @@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-files_spec.lua---files---executable---1-+-args-{-'rg'-}
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭─────────────────── Files h ────────────────────╮ -04|~ │> 97/97 (0) │ +04|~ │> 98/98 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ [DEBUG] [mt] rg --hidden --files -g "!.git" ··││ 07|~ │ .editorconfig ││ @@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 84/84 (0) │ +04|~ │> 85/85 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ LICENSE ││ 07|~ │ Makefile ││ @@ -26,7 +26,7 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All --|---------|---------|---------|---------|---------|---------|---- 01|0000000000000000000000000000000000000000000000000000000000000000
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 84/84 (0) │ +04|~ │> 85/85 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ LICENSE ││ 07|~ │ Makefile ││ @@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-files_spec.lua---files---icons---defaults---1-+-args-{-'mini',-'+attrs'-}
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 84/84 (0) │ +04|~ │> 85/85 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ LICENSE ││ 07|~ │ Makefile ││ @@ -26,7 +26,7 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All --|---------|---------|---------|---------|---------|---------|---- 01|0000000000000000000000000000000000000000000000000000000000000000
tests/screenshots/tests-files_spec.lua---files---icons---defaults---1-+-args-{-'mini',-'-attrs'-}
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 84/84 (0) │ +04|~ │> 85/85 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ LICENSE ││ 07|~ │ Makefile ││ @@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-files_spec.lua---files---multiprocess---1-+-args-{-false-}
@@ -2,11 +2,11 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 85/85 (0) │ +04|~ │> 86/86 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ [DEBUG] [st] rg --files --sort=path ││ 07|~ │ LICENSE ││ -08|~ │ Makefile ││ +08|~ │ Makefile │ 09|~ │ OPTIONS.md │ 10|~ │ README-Win.md │ 11|~ │ README.md │ @@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-files_spec.lua---files---multiprocess---1-+-args-{-true-}
@@ -2,11 +2,11 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 85/85 (0) │ +04|~ │> 86/86 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │▌ [DEBUG] [mt] rg --files --sort=path ││ 07|~ │ LICENSE ││ -08|~ │ Makefile ││ +08|~ │ Makefile │ 09|~ │ OPTIONS.md │ 10|~ │ README-Win.md │ 11|~ │ README.md │ @@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-files_spec.lua---files---preview-should-work-after-chdir-#1864
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 84/84 (0) │ +04|~ │> 85/85 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │ LICENSE ││ 07|~ │▌ Makefile │
tests/screenshots/tests-files_spec.lua---files---previewer---builtin---1-+-args-{-false,-'builtin'-}
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 85/85 (0) │ +04|~ │> 86/86 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │ [DEBUG] [mt] rg --files --sort=path -g !test··││ 07|~ │▌ LICENSE │
tests/screenshots/tests-files_spec.lua---files---previewer---builtin---1-+-args-{-false,-'ci'-}
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 85/85 (0) │ +04|~ │> 86/86 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │ [DEBUG] [mt] rg --files --sort=path -g !test··││ 07|~ │▌ LICENSE │
tests/screenshots/tests-files_spec.lua---files---previewer---builtin---1-+-args-{-true,-'builtin'-}
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 85/85 (0) │ +04|~ │> 86/86 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │ [DEBUG] [mt] rg --files --sort=path -g !test··││ 07|~ │▌ LICENSE │
tests/screenshots/tests-files_spec.lua---files---previewer---builtin---1-+-args-{-true,-'ci'-}
@@ -2,7 +2,7 @@ 01| 02|~ 03|~ ╭───────────────────── Files ─────────────────────╮ -04|~ │> 85/85 (0) │ +04|~ │> 86/86 (0) │ 05|~ │──────────────────────────────────────────────── │ 06|~ │ [DEBUG] [mt] rg --files --sort=path -g !test··││ 07|~ │▌ LICENSE │
tests/screenshots/tests-win_spec.lua---win---previewer---split-flex-hidden
@@ -22,7 +22,7 @@ 21| 22| 23| -24|fzf:// +24| > fzf-lua fzf_exec 25| 26| 27|
tests/screenshots/tests-win_spec.lua---win---previewer---split-flex-hidden-002
@@ -22,7 +22,7 @@ 21| │ │ 22| │ │ 23| ╰─────────────────────────────────────╯-24|fzf:// +24| > fzf-lua fzf_exec 25| 26| 27|
tests/screenshots/tests-win_spec.lua---win---previewer---split-flex-layout-resize
@@ -22,7 +22,7 @@ 21|│ │ 22|│ │ 23|╰──────────────────────────────────────────────────────────────╯-24|fzf:// +24| > fzf-lua fzf_exec 25| 26| 27|
tests/screenshots/tests-win_spec.lua---win---previewer---split-flex-layout-resize-002
@@ -22,7 +22,7 @@ 21| │ │ 22| │ │ 23| ╰─────────────────────────────────────╯-24|fzf:// +24| > fzf-lua fzf_exec 25| 26| 27|
tests/screenshots/tests-win_spec.lua---win---previewer---toggle_behavior=extend---1-+-args-{-{preview-=-'echo-'{}''}-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-win_spec.lua---win---previewer---toggle_behavior=extend---1-+-args-{-{profile-=-'border-fused'}-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
tests/screenshots/tests-win_spec.lua---win---previewer---toggle_behavior=extend---1-+-args-{-{winopts-=-{preview-=-{layout-=-'horizontal'},split-=-'botright-new'}}-}
@@ -22,7 +22,7 @@ 21| │ │ 22| │ │ 23| ╰────────────────────────────────────╯-24|fzf:// +24| > fzf-lua fzf_exec 25| 26| 27|
tests/screenshots/tests-win_spec.lua---win---previewer---toggle_behavior=extend---1-+-args-{-{winopts-=-{preview-=-{layout-=-'horizontal'},split-=-'botright-new'}}-}-002
@@ -22,7 +22,7 @@ 21| 22| 23| -24|fzf:// +24| > fzf-lua fzf_exec 25| 26| 27|
tests/screenshots/tests-win_spec.lua---win---previewer---toggle_behavior=extend---1-+-args-{-{winopts-=-{split-=-'enew'}}-}
@@ -22,7 +22,7 @@ 21|│ │ 22|│ │ 23|╰──────────────────────────────────────────────────────────────╯-24|fzf:// +24| > fzf-lua fzf_exec 25| 26| 27|
tests/screenshots/tests-win_spec.lua---win---previewer---toggle_behavior=extend---1-+-args-{-{winopts-=-{split-=-'enew'}}-}-002
@@ -22,7 +22,7 @@ 21| 22| 23| -24|fzf:// +24| > fzf-lua fzf_exec 25| 26| 27|
tests/screenshots/tests-win_spec.lua---win---previewer---toggle_behavior=extend---1-+-args-{-{}-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
@@ -22,7 +22,7 @@ 21| │ │ 22| │ │ 23| ╰────────────────────────────────────╯-24|fzf:// +24| > fzf-lua fzf_exec 25| 26| 27|
tests/screenshots/tests-win_spec.lua---win---reuse---1-+-args-{-{winopts-=-{split-=-'enew'}}-}
@@ -22,7 +22,7 @@ 21|│ │ 22|│ │ 23|╰──────────────────────────────────────────────────────────────╯-24|fzf:// +24| > fzf-lua fzf_exec 25| 26| 27|
tests/screenshots/tests-win_spec.lua---win---reuse---1-+-args-{-{}-}
@@ -26,4 +26,4 @@ 25| 26| 27| -28|-- TERMINAL -- 1,0-1 All +28|-- TERMINAL -- 1,3 All
@@ -163,7 +163,7 @@ T["win"]["previewer"] = new_set({ n_retry = not helpers.IS_LINUX() and 5 or nil T["win"]["previewer"]["split flex layout resize"] = function() -- Ignore terminal command line with process number local screen_opts = { ignore_text = { 24, 28 }, normalize_paths = helpers.IS_WIN() }- helpers.FzfLua.fzf_exec(child, [==[{ "foo", "bar", "baz" }]==], {+ helpers.FzfLua.fzf_exec(child, { "foo", "bar", "baz" }, { __no_abort = true, __expect_lines = true, __screen_opts = screen_opts,@@ -174,7 +174,7 @@ T["win"]["previewer"]["split flex layout resize"] = function() flip_columns = 64, } },- previewer = [[require('fzf-lua.test.previewer')]],+ previewer = function() return require("fzf-lua.test.previewer") end, keymap = { fzf = { resize = function()@@ -240,12 +240,12 @@ T["win"]["previewer"]["split flex hidden"] = function() hidden = true } },- previewer = [[require('fzf-lua.test.previewer')]],+ previewer = function() return require("fzf-lua.test.previewer") end, __after_open = function() if helpers.IS_WIN() then vim.uv.sleep(250) end end, }- helpers.FzfLua.fzf_exec(child, [==[{ "foo", "bar", "baz" }]==], opts)+ helpers.FzfLua.fzf_exec(child, { "foo", "bar", "baz" }, opts) -- increase size by 1, should flip to vertical preview child.set_size(28, 65) toggle_preview(opts, screen_opts)@@ -273,7 +273,7 @@ T["win"]["previewer"]["toggle_behavior=extend"] = new_set( toggle_behavior = "extend", preview = { hidden = true, delay = 0 }, },- previewer = [[require('fzf-lua.test.previewer')]],+ previewer = function() return require("fzf-lua.test.previewer") end, __after_open = function() if helpers.IS_WIN() then vim.uv.sleep(250) end end,@@ -284,7 +284,7 @@ T["win"]["previewer"]["toggle_behavior=extend"] = new_set( table.insert(opts.__screen_opts.ignore_text, 15) end opts = vim.tbl_extend("force", opts, o)- helpers.FzfLua.fzf_exec(child, [==[{ "foo", "bar", "baz" }]==], opts)+ helpers.FzfLua.fzf_exec(child, { "foo", "bar", "baz" }, opts) toggle_preview(opts, screen_opts) end })@@ -307,13 +307,13 @@ T["win"]["reuse"] = new_set({ toggle_behavior = "extend", preview = { hidden = false, delay = 0 }, },- previewer = [[require('fzf-lua.test.previewer')]],+ previewer = function() return require("fzf-lua.test.previewer") end, __after_open = function() if helpers.IS_WIN() then vim.uv.sleep(250) end end, } opts = vim.tbl_extend("force", opts, o)- helpers.FzfLua.fzf_exec(child, [==[{ "foo", "bar", "baz" }]==], opts)+ helpers.FzfLua.fzf_exec(child, { "foo", "bar", "baz" }, opts) -- change to fzf preview opts.previewer = nil opts.preview = "echo resue windows, change from builtin to fzf preview"@@ -321,7 +321,7 @@ T["win"]["reuse"] = new_set({ opts.__no_abort = nil exec_lua([[_G._fzf_lua_on_create = nil]]) exec_lua([[_G._fzf_load_called = nil]])- helpers.FzfLua.fzf_exec(child, [==[{ "foo", "bar", "baz" }]==], opts)+ helpers.FzfLua.fzf_exec(child, { "foo", "bar", "baz" }, opts) -- toggle_preview on hide profile reload({ "hide" })