@@ -175,4 +175,46 @@ T["api"]["fzf_live"]["rg"]["no error"] = new_set(
175175 }
176176)
177177
178+ T [" api" ][" events" ] = new_set (
179+ { parametrize = { { " fzf_exec" }, { " fzf_live" } } },
180+ {
181+ function (api )
182+ local prompt = " EventsPrompt>"
183+ helpers .FzfLua [api ](child ,
184+ api == " fzf_exec"
185+ and [[ (function() return { "foo", "bar", "baz" } end)()]]
186+ or [[ function() return { "foo", "bar", "baz" } end ]] ,
187+ {
188+ __expect_lines = true ,
189+ prompt = prompt ,
190+ exec_empty_query = true ,
191+ actions = {
192+ start = {
193+ fn = function (s ) _G ._fzf_prompt = s [1 ] end ,
194+ field_index = helpers .IS_WIN ()
195+ and " %FZF_PROMPT% %FZF_TOTAL_COUNT%"
196+ or " $FZF_PROMPT $FZF_TOTAL_COUNT" ,
197+ exec_silent = true ,
198+ },
199+ load = {
200+ fn = function (s ) _G ._fzf_total_count = tonumber (s [2 ]) end ,
201+ field_index = helpers .IS_WIN ()
202+ and " %FZF_PROMPT% %FZF_TOTAL_COUNT%"
203+ or " $FZF_PROMPT $FZF_TOTAL_COUNT" ,
204+ exec_silent = true ,
205+ },
206+ },
207+ __after_open = function ()
208+ child .wait_until (function ()
209+ return child .lua_get ([[ _G._fzf_prompt]] ) == prompt
210+ end )
211+ child .wait_until (function ()
212+ return child .lua_get ([[ _G._fzf_total_count]] ) == 3
213+ end )
214+ end ,
215+ })
216+ end
217+ }
218+ )
219+
178220return T
0 commit comments